Take post values and add them to the end of a url?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kierandes
    New Member
    • Apr 2008
    • 25

    Take post values and add them to the end of a url?

    Hi all,
    I have an iframe and I have a form. They are on separate pages. I am posting the values from the first to the other. So far so good.

    Next I was trying to get the value that I posted to be added to the end of the url
    like

    Code:
    <iframe 
    src ="http://www.google.ie/search?hl=en&q=+$_POST['searchstring']"
    width="50%" height="50%"  align="right">
    </iframe>
    Ya that code will probably look nooby but that was an attempt out of desperation :P.

    where the + is in the code above, I want to have the value of the variable come into play. Any Ideas?
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Use PHP to echo the value:
    Code:
    <iframe 
    src ="http://www.google.ie/search?hl=en&q=<?php echo $_POST['searchstring'];?>"
    width="50%" height="50%"  align="right">
    </iframe>

    Comment

    • kierandes
      New Member
      • Apr 2008
      • 25

      #3
      Thanks, worked a treat :)

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        You're welcome. Glad to help.

        Comment

        Working...