Ok so i have this PHP code imbedded into an html site that i am working on, I have little knowledge of php so bare with me.
This code displays the calendar which they can choose dates from (like the travel websites). What I need is how to grab the variables FROM PHP and put them into HTML so i can use an .ASP page to send and email to myself once they hit submit.
See attached for how the website looks.
yes, i know i can do this in html fairly easy but this is an opportunity to learn php and how it can integrate into html.
[code]
Dates of Travel:
<?php
$date3_default = “2013-08-12”;
$date4_default = “2013-08-18”;
$myCalendar = new tc_calendar(“date3”, true, false);
$myCalendar->setIcon(“calendar/images/iconCalendar.gif”);
$myCalendar->setDate(date(‘d’, strtotime($date3_default))
, date(‘m’, strtotime($date3_default))
, date(‘Y’, strtotime($date3_default)));
$myCalendar->setPath(“calendar/”);
$myCalendar->setYearInterval(1970, 2020);
$myCalendar->setAlignment(‘left’, ‘bottom’);
$myCalendar->setDatePair(‘date3’, ‘date4’, $date4_default);
$myCalendar->writeScript();
?>
<?php
$myCalendar = new tc_calendar(“date4”, true, false);
$myCalendar->setIcon(“calendar/images/iconCalendar.gif”);
$myCalendar->setDate(date(‘d’, strtotime($date4_default))
, date(‘m’, strtotime($date4_default))
, date(‘Y’, strtotime($date4_default)));
$myCalendar->setPath(“calendar/”);
$myCalendar->setYearInterval(1970, 2020);
$myCalendar->setAlignment(‘left’, ‘bottom’);
$myCalendar->setDatePair(‘date3’, ‘date4’, $date3_default);
$myCalendar->writeScript();
?>
[/code] The code below is the "submit" and "check this value" buttons. They both work and when you hit "check this value" it actually pops up with "Dates select from to ".
ie. Dates select from 2013-08-12 to 2013-08-18
But that is a java.alert and not html or php. I cant use the value “button2” for the .ASP because nothing will show up as its being executed withing the html code and doesn’t assign any values to “button2”
<p>
<input type="submit" name="Submit" value="Submit" />
<input type="button" name="button2" id="button2" value="Check the value" onClick="javascript:alert('Date select from '+this.form.date3.value+' to '+this.form.date4.value);">
This is my attempt at converting the variables to html so i can use them in the .asp file that sends the email to me. But all i get is “0” so its grabbing the dates but doing some mathematics or just printing “0” for “null”
<input type="hidden" name="dates_of_travel" value="<?php echo $date3 ' ' $date4;?>">