0

I am have a problem with Sending data from a Form to my iframe page. I have a host page that is called from the Form and the Form is using the POST method this works. I am then trying to send that same POST data with in a iframe.

<iframe src="dirread.php?var=<?php echo urlencode($_POST['filename']);?>" width="300px" height="700px" scrolling="yes"> 

So this works for one but I want to send two Lots

 <iframe src="dirread.php?var=<?php echo urlencode($_POST['filename'],$_POST['site'] );?>" width="300px" height="700px" scrolling="yes"> 

What is the correct syntax please?

1
  • You cant send post parameters from url Commented May 27, 2016 at 5:13

2 Answers 2

1

<form action="iframe.php" target="my-iframe" method="post"> <label for="text">Some text:</label> <input type="text" name="text" id="text"> <input type="submit" value="post"> </form> <iframe name="my-iframe" src="iframe.php"></iframe>

Sign up to request clarification or add additional context in comments.

Comments

0

You are sending the POST-Parameters as GET-Parameters to the iframe. To send 2 Variables you have to use:

<iframe src="dirread.php?var=<?php echo urlencode($_POST['filename']); ?>&var2=<?php echo urlencode($_POST['site'] );?>" width="300px" height="700px" scrolling="yes"> 

There is no way to send POST Data inside an iframe.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.