#1
  1. No Profile Picture
    ads
    Guest
    Devshed Newbie (0 - 499 posts)
    I am trying to pass variable type varchar, value "Travel & Tours" from one php3 file to another file. When I display it in another It only displays "Travel" and string
    "& Tours" get vanishes. Can anyone suggest me solution to display total string. I tried
    addslashes/stripslashes but thing is not working. Help appreciated
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 1999
    Posts
    114
    Rep Power
    16
  4. #3
  5. No Profile Picture
    ads
    Guest
    Devshed Newbie (0 - 499 posts)
    Sorry I am newbie to this. Not getting clue.
    I will be thankful if you give me code.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    59
    Rep Power
    14
    He is saying just to do this:

    $myvar = urlencode("Travel & Tours");

    and then just pass the var as you would normally, urlencode just changes the spaces to + and changes special characters such as & to the &amsp; or something like that.

    Chris
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 1999
    Posts
    114
    Rep Power
    16
    Right:

    $sURL = "otherfile.php?var=" . urlencode("Travel & Tours");
  10. #6
  11. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    22
    Rep Power
    0
    As a newbie don't make my mistake!
    Remember to urldecode() on the 2nd page
    $myvar="Travel & Tours";
    $StringSent=urlencode($myvar);
    then
    $StringReveived=urldecode($StringSent);
    This puts it back to how it was.

    ------------------
    With my kind regards,
    Peter.
  12. #7
  13. No Profile Picture
    ads
    Guest
    Devshed Newbie (0 - 499 posts)
    Thanks friends. It is working perfectly alright

Similar Threads

  1. Passing a comma in a string as part of post
    By jkoerber in forum PHP Development
    Replies: 3
    Last Post: February 11th, 2004, 02:52 PM
  2. array explode ( string separator, string string [, int limit])
    By beemee_freeserv in forum HTML Programming
    Replies: 4
    Last Post: February 5th, 2004, 10:56 AM
  3. PHP Session help...variable not passing
    By mrpilz in forum PHP Development
    Replies: 8
    Last Post: February 3rd, 2004, 09:02 AM
  4. Help using a database and php to update a scores page.
    By deathsythe in forum PHP Development
    Replies: 0
    Last Post: February 2nd, 2004, 02:48 PM
  5. passing array from page to page...
    By apek in forum PHP Development
    Replies: 3
    Last Post: January 30th, 2004, 02:47 PM

IMN logo majestic logo threadwatch logo seochat tools logo