Re: dates only in the future

From: Date: Tue, 25 Sep 2001 20:24:38 +0000
Subject: Re: dates only in the future
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-68768@lists.php.net to get a copy of this message
If the user submits the page and that date is wrong then dont save the data, check the data serverside. if you want the date checked before the client presses submit, your looking at doing somehting client side, javascript. php is server side only, just check the data to see if it is valid at the server, if it isnt, just send the user back with a nasty message and tell them to smarten up :) if ( time() > mktime(1, 1, 1, $month, $day, $year) ) echo "Bad !!"; else echo "Good, now I'll save the data"; -- Chris Lee lee@mediawaveonline.com "Kristjan Kanarik" <kanarik@zzz.ee> wrote in message news:200101251623.SAA17615@saturn.zzz.ee... Good afternoon, I'm looking for a function which enables me to allow user only to enter those dates which are still to come. In my head I have three <select> things... one for day, one for month and one for year. In order to prevent the user from submitting the form with the date which is in past, I need probably Javascript. Am I correct? I rather prefer to keep my site Javascript free and therefore it would be great if somebody has already written such a function and would be ready to share it with me/others. If not, any ideas how to start... ???? TIA & happy coding, Kristjan Kanarik P.S. Please put kanarik@zzz.ee to CC: line since I'm only on the digest.

« previous php.general (#68768) next »