SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot gregorious's Avatar
    Join Date
    Aug 2006
    Location
    Honolulu, HI
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    pass multiple variables in URL?

    I know how to pass one variable through a url,
    but how do I pass multiple variables?

    This is a no go.

    [ <a href='edit_residential_image.php?id=$id;&imageid=$imageid'><strong>edit</strong></a> ]

    I need to pass image ID and the residential ID.
    Thanks in advance for any help.
    G. Armento - Design, Multimedia, Illustration, Photography
    -------------------------------------------------------
    www.communications-by-design.com

  2. #2
    SitePoint Wizard gold trophysilver trophybronze trophy dc dalton's Avatar
    Join Date
    Nov 2004
    Location
    Right behind you, watching, always watching.
    Posts
    5,431
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by gregorious View Post
    I know how to pass one variable through a url,
    but how do I pass multiple variables?

    This is a no go.

    [ <a href='edit_residential_image.php?id=$id;&imageid=$imageid'><strong>edit</strong></a> ]

    I need to pass image ID and the residential ID.
    Thanks in advance for any help.
    it doesn't work because you have semi-colons after your variable values, remove them and you will be good to go

    OH and BTW . you really should use &amp; instead of & in links like this

  3. #3
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    pahe.php?var1=1&var2=2
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  4. #4
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,290
    Mentioned
    198 Post(s)
    Tagged
    3 Thread(s)

    get variables

    You shouldn't have the semi-colon after the first variable. And you should concatenate the variables into the URL string.

  5. #5
    SitePoint Zealot gregorious's Avatar
    Join Date
    Aug 2006
    Location
    Honolulu, HI
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    That did the trick!

    Okay, thanks for the quick response! Here is the fix for future readers, using "&amp;".

    [ <a href='edit_residential_image.php?id=$id&amp;imageid=$imageid'><strong>edit</strong></a> ]
    That did the trick!

    Greg
    Last edited by gregorious; Jul 29, 2007 at 14:54.
    G. Armento - Design, Multimedia, Illustration, Photography
    -------------------------------------------------------
    www.communications-by-design.com


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
  •