Page 1 of 1

Help! - posting multiple variables in a hyperlink

Posted: Mon Jul 11, 2005 4:24 am
by mhouldridge
Hi,

I would like to post to another page multiple variables within a hyperlink. Here is the code that I have;

Code: Select all

<? 
$remove = "remove";
echo "<a href='removeandstore.php?varl=".$formVars['asset']."&var2=".$formVars['software']."&var3=".$formVars['license']."'>".$remove."</a> \n"
?>
The

Code: Select all

varl=".$formVars['asset']."
one works a treat, however the following two variables do not post, or show within the address bar. I have defined everything fine, just the data isnt captured.

Please help.

Posted: Mon Jul 11, 2005 4:41 am
by timvw
The variables are in a URL -> They are available through $_GET instead of $_POST

Posted: Mon Jul 11, 2005 5:09 am
by harrisonad
yeah, tim's right. and how do you retrieve it's value, anyway? are you sure they are not 'posted' (ei. saved to $_GET)?
try...

Code: Select all

print_r($_GET);

Posted: Mon Jul 11, 2005 6:05 am
by mhouldridge
Hi,

Sorry, this is one that I have come back to. I have a page which displays the asset number, software and license in text fields. There is a remove link which when clicked posts to another page which displays this information and then prompts the user to confirm and delete the information.

This is kinda working. My address field shows for one of them the following;

http://localhost/removeandstore.php?varl=[b]000091[/b]&var2=aasdfasd&var3=fasdfasdf

As you can see this is posting correctly, however my echo commands only show the first character for the second two, ie. var2 only shows letter "a" and var3 only shows letter "f"

Any thoughts?

Posted: Mon Jul 11, 2005 6:08 am
by onion2k
mhouldridge wrote:As you can see this is posting correctly, however my echo commands only show the first character for the second two, ie. var2 only shows letter "a" and var3 only shows letter "f"

Any thoughts?
I think you're echo'ing a string as if it's an array.