rslnerd Posted November 27, 2008 Share Posted November 27, 2008 I put up a post about 20 mins ago needing help b/c my script was not loading on the page... I had a minor typo that was pointed out to me, and I fixed that... It's still not working... I'm so new to this, and I've gone over my script ten times... The page link is http://tech-shep.com/users/rslnerd/jsprogs/dow.php The script is designed to find the day of week of any day... here's the code... <html> <head> <title>Day of Week Finder</title> <?php $day = date("d"); $month = date("m"); $year = date("Y"); $today = $day; $thismonth = $month; $thisyear = $year; $done = 0; $daysofweek = array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"); $months = array("month number zero","January","February","March","April","May","June","July","August","September","October","November","December"); if ((isset($_GET[month]) && isset($_GET[day]) && isset($_GET[year])) && (checkdate($_GET[month],$_GET[day],$_GET[year])) { $month = $_GET[month]; $day = $_GET[day]; $year = $_GET[year]; $done = 1; } if ($done = 0) { $month = $realmonth; $day = $realday; $year = $realyear; $month += 10; $month %= 12; if ($month == 0) $month = 12; if (($month == 12) || ($month == 11)) $year -= 1; $year = $chyeary; $year = $chyearc; $chyeary %= 100; $chyearc = ($chyearc - $chyeary)/100; $total = $day + floor((13 * $month - 1) / 5) + $chyeary + floor($chyeary / 4) + floor($chyearc / 4) - (2 * $chyearc); $total %= 7; $dow = $daysofweek[$total]; $tense = "was"; if (($day == $today) && ($month == $thismonth) && ($year == $thisyear)) $tense = "is"; elseif (($year > $thisyear) || (($year == $thisyear) && ($month > $thismonth)) || (($year == $thisyear) && ($month == $thismonth) && ($day > $today))) $tense = "will be"; } if ($realyear < 1760) $done = 2; ?> </head> <body> <form action="dow.php" method="get"> <table border> <tr bgcolor=black> <th> <input type="text" size=1 maxlength=2 name="month" value=<?php echo $month;?>></th><th> <input type="text" size=1 maxlength=2 name="day" value=<?php echo $day;?>></th><th> <input type="text" size=3 maxlength=4 name="year" value=<?php echo $year;?>></th></tr> <tr bgcolor=blue><td> <small>Month</small></td><td> <small>Day</small></td><td> <small>Year</small></td></tr><tr bgcolor=red><th colspan=3> <input type="submit" value="Calculate"></th></tr></table> </form><br/> <?php if ($done = 1) echo "<h2>" . $day . " " . $months[$month] . " " . $year . " " . $tense . " a " . $dow . ".</h2>"; elseif ($done = 2) echo "<h3>Date must be after 1760.</h3>"; else echo "<h3>Enter any date after 1760.</h3>"; ?> </body> </html> Thanx for your time... -rslnerd Quote Link to comment https://forums.phpfreaks.com/topic/134455-page-still-loads-blank/ Share on other sites More sharing options...
rslnerd Posted November 27, 2008 Author Share Posted November 27, 2008 Never mind... as I wrote this post, someone posted one more minor error I made, and that fixed it... Thanks!! Quote Link to comment https://forums.phpfreaks.com/topic/134455-page-still-loads-blank/#findComment-700033 Share on other sites More sharing options...
PFMaBiSmAd Posted November 27, 2008 Share Posted November 27, 2008 You should be learning php, developing php code, and debugging php code on a local development system with error_reporting set to E_ALL and display_errors set to ON in your php.ini to get php to help you. (Stop and start your web server to get any changes made to php.ini to take effect.) Your learning, development, and debugging cycle will go a lot faster and since code that is not completely tested often contains security holes, doing this on a development system will be safer for your server as well. Only put completed and tested code on a live server. Quote Link to comment https://forums.phpfreaks.com/topic/134455-page-still-loads-blank/#findComment-700099 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.