My order form consists of 3 pages linked with sessions. When I arrived to the page3 the order is validated and sent out by mail. How to force the cache to be emptied when returned to page 1? Can I do it with php or with javascript?
Here a small example: (or go to http://www.paolinet.info/sessions/sessions_test/page1.php)
page1.php
<?php
session_start();
echo "<form name=\"aaaa\" method=\"post\" action=\"page2.php\">";
?>
<?php
function select( $selection , $values )
{
echo "<select name=\"$selection\">\n";
foreach( $values AS $val ) {
if ( isset( $_SESSION["$selection"] ) AND $_SESSION["$selection"] == $val )
$selected = " selected=\"selected\"";
else
$selected = "";
echo "\t<option value=\"$val\"$selected>$val</option>\n";
}
print "</select>\n";
}
?>
<?php
echo select( "selection1" , array( "0", "6", "12", "18","24", "30", "36", "42", "48" ) );
?>
<input type="submit" name="submit" value="continue" />
</form>
And page2:
<?php session_start();?>
<html>
<body>
<?php
$_SESSION['selection1'] = $_POST['selection1'];
$_SESSION['value'] = $_POST['value'];
$selection1 = $_POST['selection1'];
$value = $_POST['value'];
?>
<?php
print "you ordered $selection1 ";
?>
<input type="submit" name="submit" style="background-color:#00CC66" value=" validate your order" onClick="location.href='page3.php'">
<input type="submit" name="submit" style="background-color:#FF0000" value=" go back to change" onClick="location.href='page1.php'">
</body>
</html>
And page3:
<?php session_start();?>
<?php
$selection1 = $_SESSION['selection1'];
mail($email,$subject,$message,$headers);
print "Thank you. You ordered $selection1.</br></br>";
?>
<input type="submit" name="submit" style="background-color:#FF0000" value=" go back to page1" onClick="location.href='page1.php'">
Thanks for any kind of help.