Help using $_post function to pass data from webform to calendar

Hello I need help passing information from webform into an appointment calendar. I created a webform which allows a person to specify the days and times they are available for an appointment. What is supposed to happen is that my webform data should be sent to my calendar.php file using the $_post function. Once on the calendar.php file a user should be able to enter their name on a form and select the radio box on a specific day with the available times and schedule an appointment. It’s not clear to me how to pass the information into the calendar. My webform code is below.

Day: Monday Tuesday Wednesday Thursday Friday
Time: 7:00am 7:30am 8:00am 7:00am 7:30am 8:00am 7:00am 7:30am 8:00am 7:00am 7:30am 8:00am 1:00pm 1:30pm 2:00pm

I have messed a bit with your code to make it so you pick days you are free, then the times, then POSTs the available times to calendar.php…

code for the webform.php page
[php]

<?php //isset statement checks to see if the user has selected days, then outputs the time selections if(isset($_POST['days'])){ //POST gets the array of days they selected $days = $_POST['days']; echo " "; foreach($days as $day) { echo ""; } echo "
Day: Time:
$day 7:00am 7:30am 8:00am
"; //this is what is shown to the user when they first visit webform.php } else { echo "
Day: Monday Tuesday Wednesday Thursday Friday Saturday Sunday
"; } ?>

[/php]

code for the calendar.php page
[php]

<?php //variables set from POSTs $mon_time = $_POST['Monday']; $tue_time = $_POST['Tuesday']; $wed_time = $_POST['Wednesday']; $thurs_time = $_POST['Thursday']; $fri_time = $_POST['Friday']; $sat_time = $_POST['Saturday']; $sun_time = $_POST['Sunday']; //do what you want with the variables, I have echo'd them just to show its working echo $mon_time; echo "
"; echo $tue_time; echo "
"; echo $wed_time; echo "
"; echo $thurs_time; echo "
"; echo $fri_time; echo "
"; echo $sat_time; echo "
"; echo $sun_time; echo "
"; ?>

[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service