Have a little issue with variables passed from one if() statement to the other. The situation here is that the user can sign up for an appointment, and then once it is submitted, the URL changes and it is then dealt with from there, based on the GET vars.
Up to this point it works ok. Here's the code:
Code: Select all
<?php
if(isset($_GET['status'])){
if($_GET['status']=='addlesson'){
$date = '2004-'.$_POST['month'].'-'.$_POST['day'];
$stime = $_POST['hour'].':'.$_POST['minute'];
$etime = $_POST['ehour'].':'.$_POST['eminute'];
?>
<table width="50%">
//all the above variables are successfully echoed.
</table>
<?php
}//end status
}else{ //end if GET == status
?>
<form action="members.php?action=setappt&status=addlesson" method="post">
//form stuff
</form>To confirm, I have a hyperlink:
<a href="members.php?action=setappt&status=addlesson&valid=1>Click if Okay</a>
Now, I can't get it to recognize the variables are still there once that link is clicked. The page stays there, but the echoed variables disappear, and 0000-00-00 is entered in the database.
I've tried
Code: Select all
if(isset($_GET['valid'])){
if($_GET['valid'] == '1'){
echo "DATE: ".$date;
}
}....