Date posting problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
mhouldridge
Forum Contributor
Posts: 267
Joined: Wed Jan 26, 2005 5:13 am

Date posting problem

Post by mhouldridge »

Hi,

The following script displays a list of dates within a selection box, however when I post it, it only displays the day of the month followed by a comma.

You can see in the below that the option value={$day}, part <- this is the only bit that posts to my other script.

Any ideas?

Code: Select all

while ($day <= date('t', $month = mktime(0, 0, 0,  $i, 1, $year)))  { //Cycle thru days 
       echo "<OPTION VALUE={$day}, " 
                  .date('m', $month) 
                  .", {$year}>{$day}-" 
                  .date('m', $month)."-{$year}</OPTION>\n"; 
       $day++;
ruchit
Forum Commoner
Posts: 53
Joined: Mon Sep 26, 2005 6:03 am

Post by ruchit »

use

Code: Select all

echo "<OPTION VALUE=\"{$day}, " 
                  .date('m', $month) 
                  .", {$year}\">{$day}-" 
                  .date('m', $month)."-{$year}</OPTION>\n";
User avatar
mhouldridge
Forum Contributor
Posts: 267
Joined: Wed Jan 26, 2005 5:13 am

Post by mhouldridge »

thankyou,

that's done it
Post Reply