#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    7
    Rep Power
    0
    I've managed to send vars with links, but I have a problem with strings. I use this syntax after the original URL: ?var="STRING THAT I WANT TO SEND". When I try to print this string it prints: "STRING

    Does anyone know what I'm doing wrong?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    43
    Rep Power
    15
    It seems some browsers break on variable with spaces in them. Form submission usually takes care of this. Direct URL manipulation requires you to encode the variables. In PHP you could use:
    <?php
    $var = "STRING THAT I WANT TO SEND";
    $var = urlencode($var);
    //OR USE
    $var = ereg_replace(" ","%20",$var);
    $originalURL = "http://www.domain.com/somepage.php3";
    print("<A HREF=$originalURL?var=$var>Some Link on Page</A>");
    ?>

    I'm not sure if you need a link or not. If not you can just make a variable:
    $newURL = "$originalURL?var=$var";

    Hope this helps.

    ------------------
    webpatron.com

    [This message has been edited by lhallusa (edited July 03, 2000).]

    [This message has been edited by lhallusa (edited July 03, 2000).]
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    7
    Rep Power
    0
    That did it Thanks

Similar Threads

  1. sending multiple variables to a function
    By myrrdan in forum Visual Basic Programming
    Replies: 2
    Last Post: February 3rd, 2004, 02:07 PM
  2. sending variables to multiple frames with submit Post
    By kalmaster in forum PHP Development
    Replies: 5
    Last Post: January 15th, 2004, 04:39 PM
  3. Replies: 4
    Last Post: January 6th, 2004, 03:19 AM
  4. Loss of Referring link when sending the screen res.
    By donpearson in forum PHP Development
    Replies: 2
    Last Post: December 29th, 2003, 06:54 PM
  5. sending variables using URL ?
    By tim0 in forum Perl Programming
    Replies: 7
    Last Post: December 19th, 2003, 01:14 PM

IMN logo majestic logo threadwatch logo seochat tools logo