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?
 
ganesh_gnsConnect With a Mentor Commented:
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
 
ganesh_gnsCommented:
Hi rgb192,

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


0
 
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
All Courses

From novice to tech pro — start learning today.