SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot martin's Avatar
    Join Date
    Jun 2001
    Location
    London
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    passing variables in a URL

    Can any enlighten me on the following? I am trying to send two variables to another page with the following link:

    <A HREF="../questions/questions.php?email=<?=urlencode($email)?>pw=<?=urlencode($pw)?>">follow the link</A>

    when I check to see if they have been passed the two variables have been merged into one, ie. e-mail = joe@bloggs.com?pw=joe

    Martin

  2. #2
    This is all Mumbo Jumbo Amit's Avatar
    Join Date
    Oct 2001
    Location
    New Delhi, India
    Posts
    277
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try adding & between email and pw in the code and making it something like ...
    PHP Code:
    <A HREF="../questions/questions.php?email=<?=urlencode($email)?>&pw=<?=urlencode($pw)?>">follow the link</A>

  3. #3
    SitePoint Guru
    Join Date
    Aug 2001
    Location
    Amsterdam
    Posts
    788
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Don't you have to echo it also???
    the neigbours (free) WIFI makes it just a little more fun

  4. #4
    SitePoint Zealot martin's Avatar
    Join Date
    Jun 2001
    Location
    London
    Posts
    138
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Why didn't I think of that!

    Thanks Armit - That works just fine!

    <?= is a short cut for <? echo() and is quicker to type.

    Thanks guys this site is always my first call for PHP related problems , keep up the good work!
    Martin


Bookmarks

Posting Permissions

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