Click here to Skip to main content
15,881,173 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
AnswerRe: sending a link to php script Pin
Gerben Jongerius27-Jan-11 19:54
Gerben Jongerius27-Jan-11 19:54 
QuestionForm not working... Pin
MacRaider426-Jan-11 7:53
MacRaider426-Jan-11 7:53 
Ok been working on this for about 2 hours and I'm officially stuck.
What I'm trying to do is bild a calendar (got that part working how I want) where I can change the month.
I have the following code:
function startTable2($currentMonth,$currentYear) {
	//retreive the value of $currentMonth by name
	$month = date("F", mktime(0,0,0, date($currentMonth), date("t"), date($currentYear)));
	echo "<table border=1 align=\"center\">";
    echo "<form action=\"Calendar2.php\" method=\"post\">";
	echo "<tr>";
	echo "<td align=\"left\"><input type=\"submit\" name=\"previous\" id=\"previous\" value=\"Previous Month\" />";
	if ($currentMonth == 1) {
		$currentYear = $currentYear - 1;
		$currentMonth = 12;
	}
	else
	{
	$currentMonth = date("m", mktime(0,0,0, date($currentMonth)-1, date("1"), date($currentYear)));
	}
	echo "<input type=\"hidden\" name=\"month\" id=\"month\" value=$currentMonth /></td>";
	echo "<input type=\"hidden\" name=\"year\" id=\"year\" value=$currentYear /></td>";
	echo "<input type=\"hidden\" name=\"day\" id=\"day\" value=\"01\" /></td>";
	echo "</form>";
	echo "<td colspan=5 align=center>$month $currentYear</td>";
	echo "<form action=\"Calendar3.php\" method=\"post\">";
	if ($currentMonth == 12) {
		$currentYear = $currentYear + 1;
		$currentMonth = 1;//date("m", mktime(0,0,0, date("1"), date("1"), date($currentYear)));
	}
	else
	{
	//$newDate = mktime(0,0,0, date($currentMonth)+1, date("1"), date($currentYear));
	$currentMonth = date("m", mktime(0,0,0, date($currentMonth)+1, date("1"), date($currentYear)));//date('m', $newDate);
	}
	echo "<td align=\"right\"><input type=\"submit\" name=\"next\" id=\"next\" value=\"Next Month\" />";
	echo "<input type=\"hidden\" name=\"month1\" id=\"month1\" value=$currentMonth /></td>";
	echo "<input type=\"hidden\" name=\"year1\" id=\"year1\" value=$currentYear /></td>";
	echo "<input type=\"hidden\" name=\"day1\" id=\"day1\" value=\"01\" /></td>";
	echo "</td></form></tr>";
	echo "<tr><td align=center>Sunday</td><td align=center>Monday</td><td align=center>Tuesday</td><td align=center>Wednesday</td><td align=center>Thursday</td><td align=center>Friday</td><td align=center>Saturday</td></tr>";
}

As of now the "previous" works for every other month (i.e. December, October, August... etc) and the "next" is not working at all (blank screen). I've tried different methods for getting the new date and month but with no luck. Any help is greatly appreciated.

Thank You!
AnswerRe: Form not working... Pin
MacRaider426-Jan-11 8:33
MacRaider426-Jan-11 8:33 
Questioni cant view this file Pin
ulio.pts21-Jan-11 22:24
ulio.pts21-Jan-11 22:24 
AnswerRe: i cant view this file Pin
Kristian Sixhøj24-Jan-11 3:57
Kristian Sixhøj24-Jan-11 3:57 
QuestionThe joys of PHP mail() Pin
SRJ9221-Jan-11 9:46
SRJ9221-Jan-11 9:46 
AnswerRe: The joys of PHP mail() Pin
Dr.Walt Fair, PE21-Jan-11 12:01
professionalDr.Walt Fair, PE21-Jan-11 12:01 
GeneralRe: The joys of PHP mail() Pin
SRJ9221-Jan-11 15:06
SRJ9221-Jan-11 15:06 
GeneralRe: The joys of PHP mail() Pin
Dr.Walt Fair, PE21-Jan-11 15:33
professionalDr.Walt Fair, PE21-Jan-11 15:33 
GeneralRe: The joys of PHP mail() Pin
Fatih P.7-Feb-11 3:10
Fatih P.7-Feb-11 3:10 
AnswerRe: The joys of PHP mail() Pin
chiryphp29-Jan-11 14:46
chiryphp29-Jan-11 14:46 
Questionhtaccess without changing actual url Pin
salman ansari19-Jan-11 20:22
salman ansari19-Jan-11 20:22 
Questionuploading file via post Pin
0b4m418-Jan-11 23:13
0b4m418-Jan-11 23:13 
AnswerRe: uploading file via post Pin
Niall Barr19-Jan-11 2:32
professionalNiall Barr19-Jan-11 2:32 
GeneralRe: uploading file via post Pin
0b4m419-Jan-11 3:27
0b4m419-Jan-11 3:27 
GeneralRe: uploading file via post Pin
Niall Barr19-Jan-11 5:10
professionalNiall Barr19-Jan-11 5:10 
GeneralRe: uploading file via post Pin
0b4m419-Jan-11 5:49
0b4m419-Jan-11 5:49 
GeneralRe: uploading file via post Pin
Niall Barr19-Jan-11 6:04
professionalNiall Barr19-Jan-11 6:04 
GeneralRe: uploading file via post Pin
0b4m419-Jan-11 6:11
0b4m419-Jan-11 6:11 
GeneralRe: uploading file via post Pin
Niall Barr22-Jan-11 1:31
professionalNiall Barr22-Jan-11 1:31 
GeneralRe: uploading file via post Pin
0b4m425-Jan-11 4:11
0b4m425-Jan-11 4:11 
QuestionWhich PHP framework to use? [modified] Pin
skqi15-Jan-11 20:08
skqi15-Jan-11 20:08 
AnswerRe: Which PHP framework to use? Pin
chiryphp16-Jan-11 13:49
chiryphp16-Jan-11 13:49 
GeneralRe: Which PHP framework to use? Pin
skqi29-Jan-11 1:22
skqi29-Jan-11 1:22 
QuestionComments postings on websites - need help pls... Pin
bdesi14-Jan-11 7:23
bdesi14-Jan-11 7:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.