PHP form date issue

Hi

I have a question about one of my clients contact forms.

My client came to me yesterday and said they were having a problem with their contact form , the date field will not recognise 2011 or above.

I am really unsure what is causing the problem, it does work when i use 2010 in the date field.

The code I have in the process.php is the following

<?php

ini_set('log_errors',true);
ini_set('error_log'.'phperrs.log');

session_start();
include_once $_SERVER['DOCUMENT_ROOT'] . '/securimage/securimage.php';

$securimage = new Securimage();

if ($securimage->check($_POST['captcha_code']) == false) {
die('The code you entered was incorrect. Please press back button on your browser and try again.');
}
//create short variable names
$name=$_POST['name'];
$telephone=$_POST['phone'];
$email=$_POST['email'];
$numberOfPlayers=$_POST['number'];
$dateOfPlay=$_POST['date'];
$enquiry=$_POST['enquiry'];


$message="Client's detail as follows \
\
Name: $name \
Telephone: $telephone \
Email: $email \
Number Of Players: $numberOfPlayers \
\
Playing Date: $dateOfPlay \
\
Enquiry: $enquiry";

$name=trim($name);
$email=trim($email);
$subject=StripSlashes($subject);
$message=StripSlashes($message);
//modify the next line with your own email address
$toaddress='emailaddress';


mail($toaddress,"Website Booking Enquiry",$message,"From: $name <$email>");
//clear the variables
$name='';
$email='';
$subject='';
$message='';
echo "<script language=javascript>alert('Thank you for your request.'); window.location = 'booking.html'</script>";
?>

if anyone could help me with this problem it would be fantastic

Thanks in advance

Hi Guys

I have found what is happening to the date before process.php

function validYear(year) {
				var d = new Date();
				var currentYear = d.getFullYear();
				if( year.length!= 4) {
					alert('Not a valid year');				
					return false; 
				}
				if ( IsNumeric(year) ) {
					if( year >0 && year <=currentYear) {
						return true;
					} else {
						alert('Not a valid year');
						return false;
					}
				} else {
					return false;
				}
			} // end func
		}

Thanks

Hi

Thanks for getting back to me

Lorenw
do a print_r($_POST) also try echo $message to see what values you are getting.

I am not sure how to do this.

rguy84
I do not know what is happening with the date before process.php, our old developer did this over a year ago so I am really unsure what would be causing this. Will there be a Javascript file I need to change?

Thanks guys

do a print_r($_POST) also try echo $message to see what values you are getting.

What are you doing with the date prior to process.php?