By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,940 Members | 1,391 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,940 IT Pros & Developers. It's quick & easy.

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

P: 25
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

Expand|Select|Wrap|Line Numbers
  1. <iframe 
  2. src ="http://www.google.ie/search?hl=en&q=+$_POST['searchstring']"
  3. width="50%" height="50%"  align="right">
  4. </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?
Apr 26 '08 #1
Share this Question
Share on Google+
3 Replies


acoder
Expert Mod 15k+
P: 16,027
Use PHP to echo the value:
Expand|Select|Wrap|Line Numbers
  1. <iframe 
  2. src ="http://www.google.ie/search?hl=en&q=<?php echo $_POST['searchstring'];?>"
  3. width="50%" height="50%"  align="right">
  4. </iframe>
Apr 26 '08 #2

P: 25
Thanks, worked a treat :)
Apr 27 '08 #3

acoder
Expert Mod 15k+
P: 16,027
You're welcome. Glad to help.
Apr 28 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.