Date change.

My date “function” to define which date to use, it works with POST/GET and nothing.
If i use POST then it will get the date from that, if GET is used it will get the string from that.
If nothing is defined, use today.[php]

<?PHP if($_POST['submit']) { $dd=$_POST['dd']; $mm=$_POST['mm']; $yy=$_POST['yy']; }elseif($_GET['dd']){ $dd=$_GET['dd']; $mm=$_GET['mm']; $yy=$_GET['yy']; }else{ $dd=date('j'); $mm=date('n'); $yy=date('Y'); } $date=$dd."/".$mm."/".$yy; ?>

[/php]

File used to change date
[php]

Dato <?PHP echo $dd; ?> <?PHP $i='0'; for($i; $i < 32; $i++) { echo ''.$i.''; } ?> / <?PHP echo $mm; ?> <?PHP $i='0'; for($i; $i < 13; $i++) { echo ''.$i.''; } ?> - <>
<>
<>[/php]

My problem is that for examble if u set the date to the 14th December 2010 and press the “forward” button then it changes to the 1st Januarty 2011 - and the same if u set it to the 17th January 2011 and press the “back” button then it changes to the 31st December 2010…

I’ve tried to work it out - but i’m not sure…

Got any suggestions?

Thanks :slight_smile:

I fixed this myself.

Sponsor our Newsletter | Privacy Policy | Terms of Service