|
-
May 5th, 2005, 02:11 PM
#1
Thread Starter
Frenzied Member
Link that returns text value
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
Now happily married and still crankin' away at the keyboard.  Life is grand for a coder, no?
-
May 6th, 2005, 08:56 AM
#2
Re: Link that returns text value
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:
Code:
path/to/script.php?number=5
In your PHP script you can access it as follows:
PHP Code:
$number = $_GET['number'];
-
May 6th, 2005, 10:59 AM
#3
Thread Starter
Frenzied Member
Re: Link that returns text value
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 
Thanks for the info!
Squirrelly1
Now happily married and still crankin' away at the keyboard.  Life is grand for a coder, no?
-
May 9th, 2005, 01:12 PM
#4
Thread Starter
Frenzied Member
Re: Link that returns text value
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
Now happily married and still crankin' away at the keyboard.  Life is grand for a coder, no?
-
May 9th, 2005, 01:34 PM
#5
Re: Link that returns text value
You can separate multiple variables with an ampersand "&" and if you want an array with multiple values you use square brackets.
Code:
script.php?variable1=value&variable2=value&array[]=value1&array[]=value2
If you are going to put this link inside HTML you should encode the ampersand as it is an HTML meta character, so:
& becomes & in HTML.
Code:
script.php?variable1=value&variable2=value&array[]=value1&array[]=value2
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|