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?
    Last edited by ronverdonk; Apr 26 '08, 04:18 PM. Reason: code tags!!
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    Originally posted by kierandes
    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: ( text )
    <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?
    [html]
    href=http://google....?p=1& f=<?php echo $_POST['value'];?>
    [/html]
    Does that help?

    Comment

    • kierandes
      New Member
      • Apr 2008
      • 25

      #3
      Originally posted by markusn00b
      [html]
      href=http://google....?p=1& f=<?php echo $_POST['value'];?>
      [/html]
      Does that help?
      Yes, that helps alot ty. I that got me on the right track.
      Its doing what i want only its adding "width" to the value for example when i enter in search into the form on the first page and submit it would turn out like "searchwidt h". its probably something i've messed along the way but heres the latest with you suggestion.

      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

        #4
        Originally posted by markusn00b
        [html]
        href=http://google....?p=1& f=<?php echo $_POST['value'];?>
        [/html]
        Does that help?
        I was missing a quote :). Thanks again Mark

        Comment

        • TheServant
          Recognized Expert Top Contributor
          • Feb 2008
          • 1168

          #5
          Why are yout not using a GET form?

          Comment

          Working...