refresh iframe.php

without doing

<form target='_top' name="chooseDateForm" id="chooseDateForm" action="#" method="post">
because it makes iframe.php disappear

I need to keep the page iframe.php
date.php can disappear
date.php
<?php
require_once('../common.php');
ini_set('error_reporting', E_ALL);  
error_reporting(E_ALL);
echo '<br>this is the session:<br>';
print_r($_SESSION);
echo '<br><br>';

if (isset($_POST['date1']))
{
    $variable1 = $_POST['date1'];
    $variable2 = $_POST['date2'];

    $_SESSION['date1'] = $_POST['date1'];
    $_SESSION['date2'] = $_POST['date2'];
    
   //to print them:
   echo $variable1;
   echo $variable2;
}
?>

<form name="chooseDateForm" id="chooseDateForm" action="#" method="post">
       <fieldset>
          <div><input type='button' onclick='self.location.reload(true)' value='ReloadSelf' /></div>
          <div><input type='button' onclick='top.location.reload(true)' value='ReloadTop' /></div>
         <legend>Test date picker form</legend>

                   <ol>
                       <li>
                           <label for="date1">Date 1:</label>
             <input name="date1" id="date1" class="date-pick" />
           </li>
                       <li>
                           <label for="date2">Date 2:</label>
             <input name="date2" id="date2" class="date-pick" />

           </li>
           
           <li>          
           <input type="submit" value="Send"> 
           </li>
         
           
           
         </ol>
       </fieldset>
     </form>




--------------------------------------------------------
iframe.php
<?php
require_once('../common.php');
ini_set('error_reporting', E_ALL);  
error_reporting(E_ALL);
echo '<br>this is the session:<br>';
print_r($_SESSION);
echo '<br><br>';

echo'<iframe src="date.php" width="80%" height="510"> </iframe> ';



  
?>

Open in new window

LVL 1
rgb192Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ganesh_gnsCommented:
Hi rgb192,

You want to get the text box value in Iframe.php.Give the correct input what u want....


0
ganesh_gnsCommented:
Hi,

PF the Below Code,
Iframe.php
----------
<?php
session_start();
ini_set('error_reporting', E_ALL);  
error_reporting(E_ALL);
echo '<br>this is the session:<br>';
print_r($_SESSION);
if (!$_SESSION)
{
	echo '<br><br>';
	echo "Date " . date("H:i:s");   
	echo'<BR><iframe id = "if" name = "if" src="date.php" width="80%" height="510" border = "1"> </iframe> ';
}
?>

Date.php
----------
<?php
ini_set('error_reporting', E_ALL);  
error_reporting(E_ALL);
echo '<br>this is the session:<br>';
print_r($_SESSION);
echo '<br><br>';


if (isset($_POST['date1']))
{
	session_start();
    $variable1 = $_POST['date1'];
    $variable2 = $_POST['date2'];

    $_SESSION['date1'] = $_POST['date1'];
    $_SESSION['date2'] = $_POST['date2'];
   //to print them:
 echo $variable1;
  echo $variable2;
	?>
		<script language = "javascript">
		parent.window.document.location.href = parent.window.document.location.href ; 
		</script>
	<?php
}
?>
 <form  name="chooseDateForm" id="chooseDateForm" action="#" method="post"> 
       <fieldset>
          <div><input type='button' onclick='self.location.reload(true)' value='ReloadSelf' /></div>
          <div><input type='button' onclick='top.location.reload(true)' value='ReloadTop' /></div>
         <legend>Test date picker form</legend>

                   <ol>
                       <li>
                           <label for="date1">Date 1:</label>
             <input name="date1" id="date1" class="date-pick" />
           </li>
                       <li>
                           <label for="date2">Date 2:</label>
             <input name="date2" id="date2" class="date-pick" />

           </li>
           
           <li>          
           <input type="submit" value="Send"> 
           </li>
         
           
           
         </ol>
       </fieldset>
     </form>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rgb192Author Commented:
iframe.php

this is the session:
Array ( )

Date 08:51:15



and date.php is an empty box
0
rgb192Author Commented:
works thanks
0
rgb192Author Commented:
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.