Jump to content

Recommended Posts

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~

Link to comment
https://forums.phpfreaks.com/topic/139326-solved-php-get-with-variable/
Share on other sites

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.