What's wroung with this code?
Posted: Fri Sep 15, 2006 2:52 pm
feyd | Please use
PHP;[/syntax]
Thanks in advance...
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
This code comes from previous form and everything seems to work, however, the varialbe $month is always September and the Variable $month2 is always October no matter what I change the form to.
Form;
[syntax="html"] <select name="month">
<option selected value="select_month">Select Month
<option value="September">September
<option value="October">October
<option value="November">November
<option value="December">December
<option value="January">January
<option value="February">February
<option value="March">March
<option value="April">April
<option value="May">May
<option value="June">June
</select>Code: Select all
<?php
$month = $_POST['month'];
if ($month ='September'){
$month2 = 'October';
$year = '2006';
}elseif ($month='October'){
$month2 = 'November';
$year = '2006';
}elseif ($month='November'){
$month2 = 'December';
$year = '2006';
}elseif ($month='December'){
$month2 = 'January';
$year2 = '2007';
}elseif ($month='January'){
$month2 = 'February';
$year2 = '2007';
}elseif ($month='February'){
$month2 = 'March';
$year2 = '2007';
}elseif ($month='March'){
$month2 = 'April';
$year2 = '2007';
}elseif ($month='April'){
$month2 = 'May';
$year2 = '2007';
}else
$month2 = 'June';
$year2 = '2007';
?>Thanks in advance...
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]