0

I have two files one is index.php which contains a form which gets submitted to abc.php.Now the problem is have a frame in index.php where in i want to display the datas that i got after submitting the form to abc.php.I tried but m not able to it.Hope i hav mentioned all the thngs required. Any suggestion will be appreciated.

René Höhle
  • 26,716
  • 22
  • 73
  • 82
  • generally recommended not to use frames of any sort. –  Jan 20 '13 at 19:03
  • I think you will have to reload the frame/iframe after the data was uploaded via form (unless the form is inside the frame, then it would get updated automatically). I guess you can use javascript to reload a frame, but I am not sure. – aufziehvogel Jan 20 '13 at 19:15
  • @dagon i got two forms in index.php wic i need to display after being processed from the database ..how can i do that ...any sugesstions?? – Krisna Sharma Jan 20 '13 at 19:26
  • @aufziehvogel i tried the reload thng its not giving wat i wanted. – Krisna Sharma Jan 20 '13 at 19:27

1 Answers1

0

Set your form's target (phpfiddle demo):

<?php
if(!empty($_POST['submit_to_frame']))
{
    echo htmlspecialchars($_POST['the_data']);
}
else
{
?>
<iframe id="the_frame" name="the_frame"></iframe>
<form method="POST" target="the_frame">
    <input type="hidden" name="submit_to_frame" value="true" />
    <input type="text" name="the_data"/>
    <input type="submit" value="OK">
</form>
<?php
}
?>
Jon Hulka
  • 1,259
  • 10
  • 15
  • Thaks jon i got tat but i hav a select tag that gets it data populated from database first then based on the selection of the select tag the values will be dsplayed in frames. There is a interaction with the database then i can imlement the above problems.I guess u got wat i wanna say. – Krisna Sharma Jan 21 '13 at 03:44
  • @KrisnaSharma can you post your index.php and abc.php? – Jon Hulka Jan 21 '13 at 22:02