#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Sacramento
    Posts
    50
    Rep Power
    14
    Hello,

    I have this script that using this code echos a result:

    <? for ($i=0;$i<sizeof($domain);$i++) {echo $domain[$i]."n";} ?>

    I would then take the result of this and convert into a variable I can pass in a url:

    ie: <a href="next_script.php?domain=$My_new_variable_name">

    Any help would be greatly appreciated.

  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jul 2000
    Posts
    669
    Rep Power
    15
    Not sure what you are after but I assume sometimes $result[$i] will contain spaces and you need a way to pass as a valid varibale in a url string, you just need to rawurlencode or urlencode it like $passableurl = rawurlencode($result[$i]);

    if $result[$i] was "Hello World"

    then after the urlencode it would be "Hello+World"
  4. #3
  5. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15

    <<
    just need to rawurlencode or urlencode it like $passableurl = rawurlencode($result[$i]);
    >>


    yea,,,
    try something like this...

    <? for ($i=0;$i<sizeof($domain);$i++)
    {
    //echo $domain[$i]."n";

    $passableurl = rawurlencode($domain[$i]);

    echo "<a href="next_script.php?domain=$passableurl">$domain[$i]</a>n";
    }

    ?>

    ------------------
    SR -
    webshiju.com
    www.jobxyz.com-IT Career Portal
    ezipindia.com--WebStudio


    "The fear of the LORD is the beginning of knowledge..."
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Sacramento
    Posts
    50
    Rep Power
    14
    I'll try those suggestions. Thanks for your help!

Similar Threads

  1. A variable $_POST variable?
    By CLuver in forum PHP Development
    Replies: 0
    Last Post: February 11th, 2004, 12:55 AM
  2. How to read multiple line text file into a variable
    By gatewaycityca in forum Visual Basic Programming
    Replies: 4
    Last Post: January 29th, 2004, 12:26 PM
  3. Problem involving includes and variable
    By Thr3ddy in forum PHP Development
    Replies: 1
    Last Post: January 4th, 2004, 02:10 PM
  4. Using the echo tag to integrate a PHP variable into Javascript
    By spayce_girl in forum JavaScript Development
    Replies: 5
    Last Post: December 27th, 2003, 05:42 PM
  5. Replies: 5
    Last Post: November 16th, 2003, 11:31 AM

IMN logo majestic logo threadwatch logo seochat tools logo