Hey Guys here is my problem First site with 1 text field form. e.g http://xxx.com/mainform/index.php I've site e.g http://abc.com/index.php and I iframed http://xxx.com/mainform/index.php on http://abc.com/page2.php I've a text field on http://abc.com/index.php too, where i can put in any text(Example ITYPETHIS). The submit button will bring me to page2.php. My aim is that after i click submit, i want 'ITYPETHIS' to be shown on the field at http://xxx.com/mainform/index.php, which is being iframed on page2.php I can simply do this with post get, IF they're on the same server/host. My the problem is they're hosted at different place. Any good suggestion?
You can still use $_GET; Example, on http://abc.com/index.php have: <form action="http://xxx.com/mainform/index.php" method="get"> Text: <input type="text" name="text" /> <input type="submit" /> </form> Code (markup): And then on http://xxx.com/mainform/index.php, have: <?php echo $_GET["text"]; ?> PHP: If i enter 'ITYPETHIS' on http://abc.com/index.php and click submit, It will display 'ITYPETHIS' on http://xxx.com/mainform/index.php ... If you wanted that to be displayed within a field value, you can echo $_GET["text"] within the value of the input tag on http://xxx.com/mainform/index.php.
Read -> http://www.weberdev.com/get_example-3859.html $_POST is different to $_GET. The example i gave is using $_GET, the reason for this is because $_GET passes the submitted values via the url. Whereas $_POST doesn't, theirfore i used $_GET in this occasion because the site your submitting to is'nt on the same site. So your problem is your using $_POST instead of $_GET, follow my example.
You need to change your iframe url... soemthing like <iframe url="http://xxx.com/mainform/index.php?name=<?php echo $_GET['name']; ?>"></iframe> Code (markup): Ofcourse, if its for POST request , you need to do it differently. If you want for POST, then reframe your question.
You're not very nice to people who try to help you... For POST it would be something like this: <iframe url="http://xxx.com/mainform/index.php?name=<?php echo $_POST['name']; ?>"></iframe> Code (markup): If you can't figure out what to do then read some tutorials or something..
Thanks. But looking at it. I;m sure u know it would not work :s <?php echo $_POST['name']; ?> is from server 1, how does server 2 know what it contains?
Well of course you would have to call it using $_GET['name'] on server 2. If you're asking how to get post values into an iFrame, you could try to make a new file and use curl to send the post values that way and then link that file into the iframe. Look up curl..