swampone Posted June 30, 2010 Share Posted June 30, 2010 Ok I know that this <a href="index.php?page=3" will carry the variable in a link, but I need the actual page number to be a variable itself. This <a href="index.php?page=<?$page3?>" doesnt work. Link to comment https://forums.phpfreaks.com/topic/206245-putting-a-variable-in-a-link/ Share on other sites More sharing options...
MasterACE14 Posted June 30, 2010 Share Posted June 30, 2010 <a href="index.php?page=<?php echo $_GET['page']; ?>" Link to comment https://forums.phpfreaks.com/topic/206245-putting-a-variable-in-a-link/#findComment-1079000 Share on other sites More sharing options...
swampone Posted June 30, 2010 Author Share Posted June 30, 2010 That didnt work. I should have probably made myself more clear, sorry. After trying your solution, the url is now showing with no variable. localhost/index.php?page= I have the variable $page=3 on index.php and also on index.php I have <a href="index.php?page=<?php echo $_GET['page3']; ?>"> 3 </a> I thought maybe <a href="index.php?page=<?php echo $page3; ?>"> 3 </a> would work, but the url is now <a href="index.php?page=<a%20href%20= Link to comment https://forums.phpfreaks.com/topic/206245-putting-a-variable-in-a-link/#findComment-1079011 Share on other sites More sharing options...
swampone Posted June 30, 2010 Author Share Posted June 30, 2010 nevermind that does work, there is a problem in my coding that generates the page numbers. thanks for your help! Link to comment https://forums.phpfreaks.com/topic/206245-putting-a-variable-in-a-link/#findComment-1079016 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.