SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2009
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Passing Parameters and launching application

    Hi

    I have a URL with changing parameters in the URL line

    e.g.

    URL here....wrapper.php?First=1&Last=2

    How do I pass these URL parameters ( everything after the ? ) into a simple PHP wrapper script which simply Launches another web application with these EXACT same parameters

    so the Target may look like

    URL here....source.php?First=1&Last=2

    Many Thanks
    Andrew

  2. #2
    Web Professional
    Join Date
    Oct 2008
    Location
    London
    Posts
    862
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    header("Location: http://www.example.com/script.php?{$_SERVER['QUERY_STRING']}"); 

  3. #3
    SitePoint Enthusiast
    Join Date
    Sep 2009
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you All for your help



    AMAZING PERFECT SIMPLE


    Thank you ever so much

    HAVE A FANTASTIC DAY

  4. #4
    SitePoint Addict
    Join Date
    Nov 2008
    Location
    Peterborough, Ontario, Canada
    Posts
    316
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use the variable
    $_SERVER['QUERY_STRING'] to access everything after the ?

    or to access pieces of it use
    $_GET['first'] or $_GET['last']
    Have I helped you? You could help me.
    Like my business on facebook!
    Text message polls with real-time, live results.

  5. #5
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    header("Location: http://www.example.com/script.php?" http_build_query($_GET);); 
    Would be more robust because it will make sure to url encode the characters as needed.


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
  •