Glenugie Posted January 3, 2009 Share Posted January 3, 2009 I have a page,, which contains on it a link, this link is being generated through a get variable, but I am trying to have it as a variable. I don't think my explanation is very clear, here's the code: 80- <a href='combat.php?area=<?$area?>'>Again</a> The variable $area has been echoed and it does have the correct value, but the link ignores it, so it just links to: combat.php?area= I have a feeling the problem is because I am putting PHP tags in the middle of the link. I have tried putting the whole link in php, and I've tried putting the <a href..../a> in the tags as well, but it doesn't seem to make any difference What would I have to change to fix this? Thanks again People ~Glenugie~ Quote Link to comment https://forums.phpfreaks.com/topic/139326-solved-php-get-with-variable/ Share on other sites More sharing options...
premiso Posted January 3, 2009 Share Posted January 3, 2009 80- <a href='combat.php?area=<?php echo $area; ?>'>Again</a> I believe that is the correct way to echo it out, the other way would have been <?= but if short tags are turned off it would not work. If that does not work, paste more code please. Quote Link to comment https://forums.phpfreaks.com/topic/139326-solved-php-get-with-variable/#findComment-728719 Share on other sites More sharing options...
Glenugie Posted January 3, 2009 Author Share Posted January 3, 2009 D'oh, I knew I'd forgotten something. Thanks for helping, can't believe I'd forgotten to echo it... Quote Link to comment https://forums.phpfreaks.com/topic/139326-solved-php-get-with-variable/#findComment-728731 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.