Results 1 to 5 of 5

Thread: Link that returns text value

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2001
    Location
    USA
    Posts
    1,026

    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?

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    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']; 
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2001
    Location
    USA
    Posts
    1,026

    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?

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2001
    Location
    USA
    Posts
    1,026

    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?

  5. #5
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    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
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width