Highland3r Posted March 23, 2010 Share Posted March 23, 2010 i keep getting Error 500 on windows 2008 server online hosting package this is the code for the error in question i cant seem to pin point the exact location of the error as its my first time working with windows server 2008 <? $prm=$_REQUEST['prm']; $chm=$_REQUEST['chm']; $roomtypeid=$_REQUEST['roomtype_id']; $capacity1=$_REQUEST['capacity']; //666666666666666666666666666666666666666666666 $current_date=date('m/d/Y'); //echo $current_date.'<br>'; function GetDays($sStartDate, $sEndDate){ // Firstly, format the provided dates. // This function works best with YYYY-MM-DD // but other date formats will work thanks // to strtotime(). $sStartDate = gmdate("Y-m-d", strtotime($sStartDate)); $sEndDate = gmdate("Y-m-d", strtotime($sEndDate)); // Start the variable off with the start date $aDays = $sStartDate; // Set a 'temp' variable, sCurrentDate, with // the start date - before beginning the loop $sCurrentDate = $sStartDate; // While the current date is less than the end date while($sCurrentDate < $sEndDate){ // Add a day to the current date $sCurrentDate = gmdate("Y-m-d", strtotime("+1 day", strtotime($sCurrentDate))); // Add this new day to the aDays array $aDays = $aDays.",".$sCurrentDate; } // Once the loop has finished, return the // array of days. return $aDays; } function full_booking($array) { $ret_array=array(); $count_n=count($array); $array_1=explode(',',$array[0]); for($i=0;$i<count($array_1);$i++) { for($k=1;$k<$count_n;$k++) { if(in_array($array_1[$i],explode(',',$array[$k]))) { $f1=1; } else { $f1=0; break; } } if($f1) $ret_array[]=$array_1[$i]; } return $ret_array; } $conn1 = new COM("ADODB.Connection") or die("Cannot start ADO"); $conn1->open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=". realpath("./db/bsihbs.mdb").";"); //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ $rs50=$conn1->execute("select * from h_bookinfo where checkout_date >#".$current_date."# and roomtype_id=$roomtypeid"); $rs51=$conn1->execute("select * from h_room where roomtype_id=$roomtypeid and capacity=$capacity1"); $m50 = $rs50->Fields(13); $m51 = $rs51->Fields(0); $booked_array=array(); $available_array=array(); while(!$rs50->EOF){ $booked_array[]=$m50->value; $rs50->MoveNext(); } while(!$rs51->EOF){ $available_array[]=$m51->value; $rs51->MoveNext(); } $intersect_array = array_intersect(array_unique($booked_array),$available_array); $different_array=array_diff($available_array,$intersect_array); if(count($different_array)==0) $flag_a=1; else $flag_a=0; //vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv if($flag_a){ $rs1=$conn1->execute("select * from h_bookinfo where checkout_date >#".$current_date."# and roomtype_id=$roomtypeid order by room_id"); $f11 = $rs1->Fields(18); $f21 = $rs1->Fields(19); $f31 = $rs1->Fields(20); $f41 = $rs1->Fields(23); $f51 = $rs1->Fields(13); $f61 = $rs1->Fields(14); $allbooking=array(); $startFlag = true; $strBuff1 = ""; $strBuff2 = ""; $lastid = ""; while (!$rs1->EOF) { if($f31->value==true or $f41->value==true or ($f31->value==true and $f41->value==true)){ $rs2=$conn1->execute("select * from h_room where roomtype_id=$roomtypeid and capacity=$capacity1"); $k11 = $rs2->Fields(0); $falg1=0; while (!$rs2->EOF) { if($f51->value==$k11->value){ //$strBuff1 = $onearray[1].",".$onearray[2]; $strBuff1 = getDays($f11->value,$f21->value); if($lastid == $f51->value || $startFlag == true){ $strBuff2 = strlen($strBuff2) == 0 ? $strBuff1 : $strBuff2.",".$strBuff1; $startFlag = false; } else{ $allbooking[$lastid] = $strBuff2; $strBuff2 = $strBuff1; //echo "Buff2: ".$strBuff2."<br>"; } $lastid = $f51->value; //echo print_r($getdates); //echo '<br>'; /*$n99=count($getdates); for($kkk=0; $kkk<$n99; $kkk++){ $allbooking[]=array($f51->value,$getdates[$kkk]); }*/ //echo $f11->value.'-'.$f21->value.'->'.$f31->value.'->'.$f41->value.'->'.$f51->value.'->'.$f61->value.'<br>'; } $rs2->MoveNext(); $falg1++; } $rs2->Close(); //$rs2=$conn1->execute("select * from h_room where roomtype_id=".$f61->value); } $rs1->MoveNext(); } $allbooking[$lastid] = $strBuff2; $rs1->Close(); $conn1->Close(); if($falg1==1){ $booked_date=array(); $booked_date1=array_merge(array(),$allbooking); $booked_date=(explode(',',$booked_date1[0])); //print_r($booked_date); }else{ $allbooking=array_merge(array(),$allbooking); $booked_date=full_booking($allbooking); } } //echo '<br><br>'; //print_r($allbooking); //$allbooking=array_merge(array(),$allbooking); //echo '<br><br>'; //print_r(full_booking($allbooking)); /*echo '<br><br>'; print_r(array_repeated($allbooking)); echo '<br><br>'; print_r(array_repeated(array_repeated($allbooking))); echo '<br><br>'; print_r($booked_date); */ //hjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj if(isset($prm) and $prm > 0){ $m=$prm+$chm; }else{ $m= date("m"); } $d= date("d"); // Finds today's date $y= date("Y"); // Finds today's year $m2= date("m"); $no_of_days = date('t',mktime(0,0,0,$m,1,$y)); // This is to calculate number of days in a month $mn=date('M',mktime(0,0,0,$m,1,$y)); // Month is calculated to display at the top of the calendar $mn1=date('m',mktime(0,0,0,$m,1,$y)); //echo '<br>'.(int)$mn1.'<br>'; $yn=date('Y',mktime(0,0,0,$m,1,$y)); // Year is calculated to display at the top of the calendar $j= date('w',mktime(0,0,0,$m,1,$y)); // This will calculate the week day of the first day of the month //echo $no_of_days.'-'.$mn1.'-'.$yn; for($k=1; $k<=$j; $k++){ // Adjustment of date starting $adj .="<td > </td>"; } /// Starting of top line showing name of the days of the week ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" background="img/main_bg2.jpg"> <?php echo "<table cellspacing='0' cellpadding='4' align=left style='border:1px solid #CC6600;'><tr><td align=center bgcolor='#FF9966' style='border:1px solid #CC6600;'><font size='3' face='Tahoma'> <a href='calendar.php?prm=$m&chm=-1&roomtype_id=$roomtypeid&capacity=$capacity1'><img src='img/Navigation_icons_14.gif' border=0></a> </td><td colspan=5 align=center bgcolor='#FF9966' style='border:1px solid #CC6600;'><font size='3' face='Tahoma'>$mn $yn </td><td align=center bgcolor='#FF9966' style='border:1px solid #CC6600;'><font size='3' face='Tahoma'> <a href='calendar.php?prm=$m&chm=1&roomtype_id=$roomtypeid&capacity=$capacity1'><img src='img/Navigation_icons_10.gif' border=0></a> </td></tr><tr>"; echo "<td style='border:1px solid #CC6600; background-image:url(iimages/corner_booked_right.jpg); background-repeat:no-repeat ' width='25' ><font size='2' face='Tahoma'><b>Sun</b></font></td><td style='border:1px solid #CC6600;' width='25'><font size='2' face='Tahoma'><b>Mon</b></font></td><td style='border:1px solid #CC6600;' width='25'><font size='2' face='Tahoma'><b>Tue</b></font></td><td style='border:1px solid #CC6600;' width='25'><font size='2' face='Tahoma'><b>Wed</b></font></td><td style='border:1px solid #CC6600;' width='25'><font size='2' face='Tahoma'><b>Thu</b></font></td><td style='border:1px solid #CC6600;' width='25'><font size='2' face='Tahoma'><b>Fri</b></font></td><td style='border:1px solid #CC6600;' width='25'><font size='2' face='Tahoma'><b>Sat</b></font></td></tr><tr>"; ////// End of the top line showing name of the days of the week////////// //////// Starting of the days////////// $waiting=0; $approved=0; for($i=1;$i<=$no_of_days;$i++){ if($y <= $yn and $m2<=$mn1) { //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& if($y >= $yn and $m2==$mn1 and $d>$i) { echo $adj."<td valign=top bgcolor=#cccccc style='border:1px solid #CC6600;'><font size='2' color='#999999' face='Tahoma'>$i<br>"; // This will display the date inside the calendar cell echo " </font></td>"; } else { //#####booked date mark start######################### $n76=count($booked_date); for($pp=0;$pp<$n76;$pp++) { $b_date= $booked_date[$pp]; $exp_date=explode('-',$b_date); $b_year=$exp_date[0]; $b_month=$exp_date[1]; $b_day=$exp_date[2]; //echo $pp; if($yn==$b_year and $mn1==$b_month and $i==(int)$b_day) { $flag=1; } } //#####booked date mark start######################### if($flag) { echo $adj."<td valign=top bgcolor=#f7b961 style='border:1px solid #CC6600;'><font size='2' face='Tahoma'>$i<br>"; // This will display the date inside the calendar cell //echo $aaaaa;$aaaaa echo " </font></td>"; $flag=0; } else { echo $adj."<td valign=top bgcolor=#ffffff style='border:1px solid #CC6600;'><font size='2' face='Tahoma'>$i<br>"; //echo $aaaaa;// This will display the date inside the calendar cell echo " </font></td>"; } } } else { echo $adj."<td valign=top bgcolor=#cccccc style='border:1px solid #CC6600;'><font size='2' color='#999999' face='Tahoma'>$i<br>"; // This will display the date inside the calendar cell echo " </font></td>"; } $adj=''; $j ++; if($j==7){echo "</tr><tr>"; $j=0;} } echo "</tr></table>"; ?> </body> </html> Quote Link to comment Share on other sites More sharing options...
Highland3r Posted March 31, 2010 Author Share Posted March 31, 2010 ANYBODY ? ? ? ? ? ? ? Quote Link to comment Share on other sites More sharing options...
Highland3r Posted April 3, 2010 Author Share Posted April 3, 2010 so no one can help with this problem no suggestions Quote Link to comment Share on other sites More sharing options...
Mchl Posted April 3, 2010 Share Posted April 3, 2010 Are you running Apache or IIS? Quote Link to comment Share on other sites More sharing options...
Highland3r Posted April 7, 2010 Author Share Posted April 7, 2010 I beleve it is IIS not 100% sure tho Quote Link to comment Share on other sites More sharing options...
Highland3r Posted April 13, 2010 Author Share Posted April 13, 2010 if nobody can help with this problem please suggest somewere i may get help with it ??? Quote Link to comment Share on other sites More sharing options...
Mchl Posted April 13, 2010 Share Posted April 13, 2010 You might want to try here: http://forums.iis.net/ or other official Microsoft communities. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted April 13, 2010 Share Posted April 13, 2010 Has that code worked ever, such as on your development system, before you put it on to a live hosting server? Quote Link to comment Share on other sites More sharing options...
Highland3r Posted April 15, 2010 Author Share Posted April 15, 2010 yes but it worked on windows 2003 server and my hosting provider upgraded to 2008 and cannot seem to rid the 500 error? any ideas Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted April 15, 2010 Share Posted April 15, 2010 The HTTP 500 response code just means that a complete response was not sent by the web server. On the outside chance that you are experinecing a fatal runtime error, add the following two lines of code immediately after the first opening <?php tag (you should only use full opening php tags as well) - ini_set("display_errors", "1"); error_reporting(E_ALL); Quote Link to comment Share on other sites More sharing options...
Highland3r Posted April 15, 2010 Author Share Posted April 15, 2010 i added the code after the <?PHP and does not display any error apart from error 500 any other ideas? Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted April 15, 2010 Share Posted April 15, 2010 Have you tried a simple .php file to see if any php code works - <?php phpinfo(); ?> Quote Link to comment Share on other sites More sharing options...
Highland3r Posted April 15, 2010 Author Share Posted April 15, 2010 i created a file called test.php and only code in it was <?php phpinfo(); ?> and no error returned just blank white page? Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted April 15, 2010 Share Posted April 15, 2010 Php is not installed, is not enabled, or it is not functioning. Quote Link to comment Share on other sites More sharing options...
Highland3r Posted April 15, 2010 Author Share Posted April 15, 2010 but i dont get any error just blank page plus <?php print "Hello World!"; ?> works fine? Quote Link to comment Share on other sites More sharing options...
Highland3r Posted April 16, 2010 Author Share Posted April 16, 2010 error report response suggest the following errors HTTP/1.1 500 Internal Server Error Server: Microsoft-IIS/7.0 X-Powered-By: ASP.NET Date: Fri, 16 Apr 2010 15:39:43 GMT Connection: close Content-Length: 1044 PHP Notice: Undefined variable: m in \\10.0.3.22\home\thunderhosts.co.uk\public_html\calendar.php on line 201 PHP Notice: Undefined variable: roomtypeid in \\10.0.3.22\home\thunderhosts.co.uk\public_html\calendar.php on line 201 PHP Notice: Undefined variable: capacity1 in \\10.0.3.22\home\thunderhosts.co.uk\public_html\calendar.php on line 201 PHP Notice: Undefined variable: mn in \\10.0.3.22\home\thunderhosts.co.uk\public_html\calendar.php on line 201 PHP Notice: Undefined variable: yn in \\10.0.3.22\home\thunderhosts.co.uk\public_html\calendar.php on line 201 PHP Notice: Undefined variable: m in \\10.0.3.22\home\thunderhosts.co.uk\public_html\calendar.php on line 201 PHP Notice: Undefined variable: roomtypeid in \\10.0.3.22\home\thunderhosts.co.uk\public_html\calendar.php on line 201 PHP Notice: Undefined variable: capacity1 in \\10.0.3.22\home\thunderhosts.co.uk\public_html\calendar.php on line 201 PHP Notice: Undefined variable: no_of_days in \\10.0.3.22\home\thunderhosts.co.uk\public_html\calendar.php on line 210 the code in question is Line 201 echo "<table cellspacing='0' cellpadding='4' align=left style='border:1px solid #CC6600;'><tr><td align=center bgcolor='#FF9966' style='border:1px solid #CC6600;'><font size='3' face='Tahoma'> <a href='calendar.php?prm=$m&chm=-1&roomtype_id=$roomtypeid&capacity=$capacity1'><img src='img/Navigation_icons_14.gif' border=0></a> </td><td colspan=5 align=center bgcolor='#FF9966' style='border:1px solid #CC6600;'><font size='3' face='Tahoma'>$mn $yn </td><td align=center bgcolor='#FF9966' style='border:1px solid #CC6600;'><font size='3' face='Tahoma'> <a href='calendar.php?prm=$m&chm=1&roomtype_id=$roomtypeid&capacity=$capacity1'><img src='img/Navigation_icons_10.gif' border=0></a> </td></tr><tr>"; Line 210 for($i=1;$i<=$no_of_days;$i++){ Quote Link to comment Share on other sites More sharing options...
Mchl Posted April 16, 2010 Share Posted April 16, 2010 All these 'Undefined variable' notices mean, that variables mentioned in these messages are not assigned any value. Make sure you assign a value to a variable before you use it. Quote Link to comment Share on other sites More sharing options...
Highland3r Posted April 16, 2010 Author Share Posted April 16, 2010 i beleve the error could lie within this part of code $no_of_days=date('t',mktime(0,0,0,$m,1,$y)); is there any obvious error here? or am i going the wrong direction?? this is starting to drive me crazy lol been working on this problem for over a month any help apreciated Quote Link to comment Share on other sites More sharing options...
Mchl Posted April 16, 2010 Share Posted April 16, 2010 Nothing wrong with it as long as $m and $y hold any values. Quote Link to comment Share on other sites More sharing options...
Highland3r Posted April 16, 2010 Author Share Posted April 16, 2010 were would i find the values ? i thought it was generic and as i am working with a 3rd party dcript im not 100% sure any suggestions? Quote Link to comment Share on other sites More sharing options...
Mchl Posted April 16, 2010 Share Posted April 16, 2010 Do echo $m,$y; before this line, and if it displays actual month and year, that means the values are there Quote Link to comment Share on other sites More sharing options...
Highland3r Posted April 16, 2010 Author Share Posted April 16, 2010 but the problem is i get error 500 :'( i cant trouble shoot the script all i know is the above Quote Link to comment Share on other sites More sharing options...
Mchl Posted April 16, 2010 Share Posted April 16, 2010 That's something I can't really understand. You should either get a server error, or some output from the script (like these PHP Notices). You're getting both... It's the first time I see anything like that... Quote Link to comment Share on other sites More sharing options...
Highland3r Posted April 16, 2010 Author Share Posted April 16, 2010 when i change line 210 to for($i=1;$i<=$no_of_days i++){ from for($i=1;$i<=$no_of_days; i++){ then i only get error HTTP/1.1 500 Internal Server Error Server: Microsoft-IIS/7.0 X-Powered-By: ASP.NET Date: Fri, 16 Apr 2010 19:39:14 GMT Connection: close Content-Length: 140 PHP Parse error: syntax error, unexpected T_INC, expecting ';' in \\10.0.3.22\home\thunderhosts.co.uk\public_html\calendar.php on line 210 any ideas i beleve if i can get this error then the script will run ? the calendar.php code is <? $prm=$_REQUEST['prm']; $chm=$_REQUEST['chm']; $roomtypeid=$_REQUEST['roomtype_id']; $capacity1=$_REQUEST['capacity']; //666666666666666666666666666666666666666666666 $current_date=date('m/d/Y'); //echo $current_date.'<br>'; function GetDays($sStartDate, $sEndDate){ // Firstly, format the provided dates. // This function works best with YYYY-MM-DD // but other date formats will work thanks // to strtotime(). $sStartDate = gmdate("Y-m-d", strtotime($sStartDate)); $sEndDate = gmdate("Y-m-d", strtotime($sEndDate)); // Start the variable off with the start date $aDays = $sStartDate; // Set a 'temp' variable, sCurrentDate, with // the start date - before beginning the loop $sCurrentDate = $sStartDate; // While the current date is less than the end date while($sCurrentDate < $sEndDate){ // Add a day to the current date $sCurrentDate = gmdate("Y-m-d", strtotime("+1 day", strtotime($sCurrentDate))); // Add this new day to the aDays array $aDays = $aDays.",".$sCurrentDate; } // Once the loop has finished, return the // array of days. return $aDays; } function full_booking($array) { $ret_array=array(); $count_n=count($array); $array_1=explode(',',$array[0]); for($i=0;$i<count($array_1);$i++) { for($k=1;$k<$count_n;$k++) { if(in_array($array_1[$i],explode(',',$array[$k]))) { $f1=1; } else { $f1=0; break; } } if($f1) $ret_array[]=$array_1[$i]; } return $ret_array; } $conn1 = new COM("ADODB.Connection") or die("Cannot start ADO"); $conn1->open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=". realpath("http://www.thunderhosts.co.uk/db/bsihbs.mdb").";"); //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ $rs50=$conn1->execute("select * from h_bookinfo where checkout_date >#".$current_date."# and roomtype_id=$roomtypeid"); $rs51=$conn1->execute("select * from h_room where roomtype_id=$roomtypeid and capacity=$capacity1"); $m50 = $rs50->Fields(13); $m51 = $rs51->Fields(0); $booked_array=array(); $available_array=array(); while(!$rs50->EOF){ $booked_array[]=$m50->value; $rs50->MoveNext(); } while(!$rs51->EOF){ $available_array[]=$m51->value; $rs51->MoveNext(); } $intersect_array = array_intersect(array_unique($booked_array),$available_array); $different_array=array_diff($available_array,$intersect_array); if(count($different_array)==0) $flag_a=1; else $flag_a=0; //vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv if($flag_a){ $rs1=$conn1->execute("select * from h_bookinfo where checkout_date >#".$current_date."# and roomtype_id=$roomtypeid order by room_id"); $f11 = $rs1->Fields(18); $f21 = $rs1->Fields(19); $f31 = $rs1->Fields(20); $f41 = $rs1->Fields(23); $f51 = $rs1->Fields(13); $f61 = $rs1->Fields(14); $allbooking=array(); $startFlag = true; $strBuff1 = ""; $strBuff2 = ""; $lastid = ""; while (!$rs1->EOF) { if($f31->value==true or $f41->value==true or ($f31->value==true and $f41->value==true)){ $rs2=$conn1->execute("select * from h_room where roomtype_id=$roomtypeid and capacity=$capacity1"); $k11 = $rs2->Fields(0); $falg1=0; while (!$rs2->EOF) { if($f51->value==$k11->value){ //$strBuff1 = $onearray[1].",".$onearray[2]; $strBuff1 = getDays($f11->value,$f21->value); if($lastid == $f51->value || $startFlag == true){ $strBuff2 = strlen($strBuff2) == 0 ? $strBuff1 : $strBuff2.",".$strBuff1; $startFlag = false; } else{ $allbooking[$lastid] = $strBuff2; $strBuff2 = $strBuff1; //echo "Buff2: ".$strBuff2."<br>"; } $lastid = $f51->value; //echo print_r($getdates); //echo '<br>'; /*$n99=count($getdates); for($kkk=0; $kkk<$n99; $kkk++){ $allbooking[]=array($f51->value,$getdates[$kkk]); }*/ //echo $f11->value.'-'.$f21->value.'->'.$f31->value.'->'.$f41->value.'->'.$f51->value.'->'.$f61->value.'<br>'; } $rs2->MoveNext(); $falg1++; } $rs2->Close(); //$rs2=$conn1->execute("select * from h_room where roomtype_id=".$f61->value); } $rs1->MoveNext(); } $allbooking[$lastid] = $strBuff2; $rs1->Close(); $conn1->Close(); if($falg1==1){ $booked_date=array(); $booked_date1=array_merge(array(),$allbooking); $booked_date=(explode(',',$booked_date1[0])); //print_r($booked_date); }else{ $allbooking=array_merge(array(),$allbooking); $booked_date=full_booking($allbooking); } } //echo '<br><br>'; //print_r($allbooking); //$allbooking=array_merge(array(),$allbooking); //echo '<br><br>'; //print_r(full_booking($allbooking)); /*echo '<br><br>'; print_r(array_repeated($allbooking)); echo '<br><br>'; print_r(array_repeated(array_repeated($allbooking))); echo '<br><br>'; print_r($booked_date); */ //hjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj if(isset($prm) and $prm > 0){ $m=$prm+$chm; }else{ $m=date("m"); } $d=date("d"); // Finds today's date $y=date("Y"); // Finds today's year $m2=date("m"); $no_of_days=date('j',mktime(0,0,0,$m,1,$y)); // This is to calculate number of days in a month $mn=date('M',mktime(0,0,0,$m,1,$y)); // Month is calculated to display at the top of the calendar $mn1=date('m',mktime(0,0,0,$m,1,$y)); //echo '<br>'.(int)$mn1.'<br>'; $yn=date('Y',mktime(0,0,0,$m,1,$y)); // Year is calculated to display at the top of the calendar $j=date('w',mktime(0,0,0,$m,1,$y)); // This will calculate the week day of the first day of the month //echo $no_of_days.'-'.$mn1.'-'.$yn; for($k=1; $k<=$j; $k++){ // Adjustment of date starting $adj .="<td > </td>"; } /// Starting of top line showing name of the days of the week ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" background="img/main_bg2.jpg"> <?php echo "<table cellspacing='0' cellpadding='4' align=left style='border:1px solid #CC6600;'><tr><td align=center bgcolor='#FF9966' style='border:1px solid #CC6600;'><font size='3' face='Tahoma'> <a href='calendar.php?prm=$m&chm=-1&roomtype_id=$roomtypeid&capacity=$capacity1'><img src='img/Navigation_icons_14.gif' border=0></a> </td><td colspan=5 align=center bgcolor='#FF9966' style='border:1px solid #CC6600;'><font size='3' face='Tahoma'>$mn $yn </td><td align=center bgcolor='#FF9966' style='border:1px solid #CC6600;'><font size='3' face='Tahoma'> <a href='calendar.php?prm=$m&chm=1&roomtype_id=$roomtypeid&capacity=$capacity1'><img src='img/Navigation_icons_10.gif' border=0></a> </td></tr><tr>"; echo "<td style='border:1px solid #CC6600; background-image:url(images/corner_booked_right.jpg); background-repeat:no-repeat ' width='25' ><font size='2' face='Tahoma'><b>Sun</b></font></td><td style='border:1px solid #CC6600;' width='25'><font size='2' face='Tahoma'><b>Mon</b></font></td><td style='border:1px solid #CC6600;' width='25'><font size='2' face='Tahoma'><b>Tue</b></font></td><td style='border:1px solid #CC6600;' width='25'><font size='2' face='Tahoma'><b>Wed</b></font></td><td style='border:1px solid #CC6600;' width='25'><font size='2' face='Tahoma'><b>Thu</b></font></td><td style='border:1px solid #CC6600;' width='25'><font size='2' face='Tahoma'><b>Fri</b></font></td><td style='border:1px solid #CC6600;' width='25'><font size='2' face='Tahoma'><b>Sat</b></font></td></tr><tr>"; ////// End of the top line showing name of the days of the week////////// //////// Starting of the days////////// $waiting=0; $approved=0; for($i=1;$i<=$no_of_days i++){ if($y <= $yn and $m2<=$mn1) { //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& if($y >= $yn and $m2==$mn1 and $d>$i) { echo $adj."<td valign=top bgcolor=#cccccc style='border:1px solid #CC6600;'><font size='2' color='#999999' face='Tahoma'>$i<br>"; // This will display the date inside the calendar cell echo " </font></td>"; } else { //#####booked date mark start######################### $n76=count($booked_date); for($pp=0;$pp<$n76;$pp++) { $b_date= $booked_date[$pp]; $exp_date=explode('-',$b_date); $b_year=$exp_date[0]; $b_month=$exp_date[1]; $b_day=$exp_date[2]; //echo $pp; if($yn==$b_year and $mn1==$b_month and $i==(int)$b_day) { $flag=1; } } //#####booked date mark start######################### if($flag) { echo $adj."<td valign=top bgcolor=#f7b961 style='border:1px solid #CC6600;'><font size='2' face='Tahoma'>$i<br>"; // This will display the date inside the calendar cell //echo $aaaaa;$aaaaa echo " </font></td>"; $flag=0; } else { echo $adj."<td valign=top bgcolor=#ffffff style='border:1px solid #CC6600;'><font size='2' face='Tahoma'>$i<br>"; //echo $aaaaa;// This will display the date inside the calendar cell echo " </font></td>"; } } } else { echo $adj."<td valign=top bgcolor=#cccccc style='border:1px solid #CC6600;'><font size='2' color='#999999' face='Tahoma'>$i<br>"; // This will display the date inside the calendar cell echo " </font></td>"; } $adj=''; $j ++; if($j==7){echo "</tr><tr>"; $j=0;} } echo "</tr></table>"; ?> </body> </html> [code] Quote Link to comment Share on other sites More sharing options...
Mchl Posted April 16, 2010 Share Posted April 16, 2010 Syntax errors are 'discovered' before any runtime errors (such as notices you were getting before). That's why you're getting a shorter error message now, but it doesn't mean you fixed these errors. On contrary, you introduced a new one, that doesn't even allow the script to run. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.