I need a link that will return the value of the text that was linked from...
for instance...
if I have a link that says "1" or "2" or "3" I need to be able to get "1" or "2" or "3", respectively, into a variable...
Thanks,
squirrelly1
Printable View
I need a link that will return the value of the text that was linked from...
for instance...
if I have a link that says "1" or "2" or "3" I need to be able to get "1" or "2" or "3", respectively, into a variable...
Thanks,
squirrelly1
What do you mean? You can pass a variable in the query string. So if you wanted to send a PHP script a variable named number you would use the following:
In your PHP script you can access it as follows:Code:path/to/script.php?number=5
PHP Code:$number = $_GET['number'];
Well, the thing is... I have a bunch of things listed in a table that I'm pulling from a MySQL database to populate with. I need to be able to select items ....
wait a sec... I got it... I'll just create the link accordingly when I create my table :D
Thanks for the info!
Squirrelly1
How could I have mulitple values in the address?
like if I needed the variables named 'id' and 'name' in the address how would I format it?
thanks,
squirrelly1
You can separate multiple variables with an ampersand "&" and if you want an array with multiple values you use square brackets.
If you are going to put this link inside HTML you should encode the ampersand as it is an HTML meta character, so:Code:script.php?variable1=value&variable2=value&array[]=value1&array[]=value2
& becomes & in HTML.
Code:script.php?variable1=value&variable2=value&array[]=value1&array[]=value2