Jump to content

[SOLVED] Trouble with passing url variable and date();


aebstract

Recommended Posts

I don't know why it is messing up the way it is, but I am entering in my url: month=November, then I am setting

$month = $_GET['month'];

Then echo out $month and it displays November.

Then I try to do:

$date = date('$month 1 Y');

and echo out $date and it gives me: $09o93002

 

Any answers to why this is doing this and how I can insert the month in to that date variable would be great. Thanks

Okay now I am getting:

 

-0500c30obeThu, 11 Sep 2008 14:25:53 -0500 1 2008 

 

with this:

 

if (isset($_GET['month'])){

$month = $_GET['month'];
$date = date("$month 1 Y");
$weekday = date('w', strtotime($date));
echo $date;

} else {

Yeah pretty much the only thing that will change is the month and year, even though I'm not showing year in the example. When I get the month working I will do the year the same way. So when I echo this as

$date = date('F 1 Y');
$weekday = date('w', strtotime($date));
echo $date;

it is September 1 2008, so yeah same thing with whatever Month I decide to put through to it.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.