amylou Posted August 14, 2007 Share Posted August 14, 2007 what i am trying to do is to get this to work, it will allow me to get to the administration2.php(second code) but shows a blank page, i would like it to include the datesoff.php page(3rdCode) thank you for your help. i thought maybe my include was wrong but have tried different things.amy <head> <title>Supervisor Log In</title> <link href="basic.css" rel="stylesheet" type="text/css" /> <link href= "detail.css" rel="stylesheet" type="text/css" /> <link href="links.css" rel="stylesheet" type="text/css"/> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <table border= '0' width= '700'><tr> <td colspan= '2' align= 'center'> </td></tr> <tr> <td colspan= '2' align= 'center'><b>Supervisor Login</b></td> </tr> <tr><td colspan= '2' align= 'center'> </td></tr> <form name='form1' method='post' action='administration2.php'> <tr> <td colspan= '2' align= 'center'><b>Enter username and password</b></td> </tr> <tr> <td width= '250' align='right'>User Name:</td> <td> <input type= 'text' name= 'userID' maxlength= '25'> </td> </tr> <tr> <td width= '250' align='right'>Password:</td> <td> <input type= 'password' name= 'password' maxlength= '25'> </td> </tr> <tr><td colspan= '2' align= 'center'> </td></tr> <tr> <td colspan= '2'> <center> <input type= 'hidden' name='action' value= 'submitted'> <input type = "submit" name = "submit" value="LOGIN!!!!"> </center> </td> </tr></form> </table> <?php session_name(); session_start(); include'mysqlconnectectsitel.inc.php'; ?> <html> <head> <title>Administration</title> <link href= "basic.css" rel= "stylesheet" type= "text/css" /> <link href= "detail.css" rel= "stylesheet" type= "text/css" /> <link href= "links.css" rel= "stylesheet" type= "text/css"/> </head> <body> <?php $userID = $_SESSION['userID']; if(isset($_POST['action'])) { $actions= $_POST['action']; } else { $actions=""; } if ( $actions != 'submitted' && !(session_is_registered('userID')) ) { include ( "${_SERVER['DOCUMENT_ROOT']}/login2.php" ); } else { if(!(session_is_registered('userID'))) { // User is loging in. $userid = $_POST['userID']; $password = $_POST['password']; if(empty($password)) {die("Empty Password.Please <a href='administration2.php'> Click here </a> to login in again.");} //query the database for the specified user and extract the cooresponding password $sqlquery = "SELECT * FROM login WHERE username= '$userID' "; $queryresult= mysql_query($sqlquery) or die("User not found. Please <a href='administration2.php'> Click here </a> to login in again."); $rowcount = mysql_num_rows($queryresult); if ($rowcount== 0) {die("User not found. Please <a href='administration2.php'> Click here </a> to login in again.");} $info = (mysql_fetch_row($queryresult)); $userID = $info[0]; $username_in_db = $info[1]; $password_in_db = $info[2]; if(!(md5($password) ==$password_in_db){die("Invalid password. Please <a href='administration2.php'> Click here </a> to login in again.");} //register session variables session_register('userID'); //add to the session superglobal arrary $_SESSION['userID']=$userID; $_SESSION['isusername']=$isusername_in_db; //$_SESSION['isUserAdmin']=$isUserAdmin_in_db; if(!(session_is_registered('userID'))) { session_unset(); session_destroy(); die("Login unsuccessful. Please <a href='administration2.php'> Click here </a> to try in again."); } } include 'TimeOff.php'; $actions=""; } ?> </body></html> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <?php /*this program was designed to eliminate paper work for the sift supervisors and the csps that work at Sitel here at loring. this program was written and developed by Amy Coppola on July 2007 */ ?> <?PHP include'mysqlconnectsitel.inc.php';?> <title>datesoff</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="links.css" rel="stylesheet" type="text/css"/> <link href="general.css" rel="stylesheet" type="text/css"/> </head> <body> <h1> <img src="33720001.jpg" alt="sitel" width="300" height="100" /> <?PHP extract ($_POST); if(isset($_POST['action'])) { $actions= $_POST['action']; } else { $actions=""; } if ( $actions == "" ) { ?> <form name='datesoff' method='post' action='datesoff.php'> <?PHP $sqlquery = "SELECT * FROM timeoff ORDER BY 'requestedDate' ASC "; $queryresult= mysql_query($sqlquery) or die("No Dates found. To return to previous page <a href=datesoff.php> Click here.</a>"); $rowcount = mysql_num_rows($queryresult); if ($rowcount== 0) { $actions=""; die("No Dates found. To return to previous page <a href=datesoff.php> Click here.</a> "); } ?> <select name="requestedDate"> <?PHP for( $i = 0; $i < $rowcount; $i++ ) { $info = (mysql_fetch_row($queryresult)); $requestedDate = "$info[8]"; echo"<option value =\"$info[8]\">$requestedDate</option>"; } ?> <input type= "hidden" name= "action" value= "requestedDate"> <input type = "submit" name = "select_date" value= "Select Date"> <?PHP ?> </select> </form> <?PHP } else if( $actions == "requestedDate" ) { ?> <form name='datesoff' method='post' action='datesoff.php'> <?PHP $myrequestedDate = !isset($_POST['requestedDate'])? NULL : $_POST['requestedDate']; $sqlquery = "SELECT * FROM timeoff WHERE requestedDate = '$myrequestedDate'"; $queryresult= mysql_query($sqlquery) or die("No shifts found. To return to dates off <a href='datesoff.php'> Click here</a> ."); $rowcount = mysql_num_rows($queryresult); if ($rowcount== 0) {die("No dates found. To return to dates off <a href='datesoff.php'> Click here</a> ."); } $info = (mysql_fetch_row($queryresult)); $requestedDate = "$info[8]"; echo "<p>$requestedDate</p>"; echo "<input type='hidden' name='requestedDate' value='$requestedDate'>"; $sqlquery = "SELECT * FROM timeoff WHERE requestedDate = '$requestedDate' "; //$sqlquery = "SELECT * FROM verifiertimeoff WHERE requestedDate = '$myrequestedDate'"; $queryresult= mysql_query($sqlquery) or die("No dates found. To return to dates off<a href='datesoff.php'> Click here</a> ."); $rowcount = mysql_num_rows($queryresult); if ($rowcount== 0) {die("No dates found. To return to dates off<a href='datesoff.php'>Click here</a> ."); } echo "<p>To select a different date <a href='datesoff.php'>click here</a>.</p>"; ?> <select name="shift"> <?PHP for( $i = 0; $i < $rowcount; $i++ ) { $info = (mysql_fetch_row($queryresult)); echo"<option value =\"$info[3]\">$info[3]</option>"; } ?> </select> <input type = "hidden" name= "action" value= "shift"> <input type = "submit" name= "select_shift" value= "Select Shift"> </form> <?PHP } else if( $actions == "shift" ) { ?> <?PHP $myShift = !isset($_POST['shift'])? NULL : $_POST['shift']; $myrequestedDate = !isset($_POST['requestedDate'])? NULL : $_POST['requestedDate']; echo "<p>$myrequestedDate</p>"; $sqlquery = "SELECT * FROM timeoff WHERE requestedDate = '$myrequestedDate' AND shift = '$myShift'"; //$sqlquery = "SELECT * FROM verifiertimeoff WHERE requestedDate = '$myrequestedDate' AND shift = '$myShift'"; $queryresult= mysql_query($sqlquery) or die("No shifts found. To return to dates off <a href='datesoff.php'> Click here</a> ."); $rowcount = mysql_num_rows($queryresult); if ($rowcount== 0) { die("No dates found. To return to dates off <a href='datesoff.php'> Click here</a> ."); } echo "<p>$myShift</p>"; ?> <table border='1'> <tr> <th></th> <th>Request ID</th> <th>First Name</th> <th>Last Name</th> <th>Shift</th> <th>Saturday</th> <th>Verifier</th> <th>Paid/Unpaid</th> <th>Todays Date</th> <th>Date Requested Off</th> <th>Time Requested Off</th> <th>Number of Hours</th> <th>Date Rescheduled</th> <th>Time Rescheduled</th> <th>Rescheduled Hours</th> <th>Reason</th> </tr> <?PHP for( $i = 1; $i <= $rowcount; $i++ ) { $info = (mysql_fetch_row($queryresult)); echo"<tr><td>$i</td><td>$info[0]</td><td>$info[1]</td><td>$info[2]</td><td>$info[3]</td><td>$info[4]</td><td>$info[5]</td><td>$info[6]</td><td>$info[7]</td><td>$info[8]</td><td>$info[9]</td><td>$info[10]</td><td>$info[11]</td><td>$info[12]</td><td>$info[13]</td><td>$info[14]</td> </tr>"; } ?> </table> <?PHP echo "<p>To select a different date <a href='datesoff.php'>click here</a>.</p>"; } ?> </head> </body> </html> Quote Link to comment Share on other sites More sharing options...
fenway Posted August 20, 2007 Share Posted August 20, 2007 I'm not going to wade through all of that code... what exactly is the problem? Quote Link to comment Share on other sites More sharing options...
amylou Posted August 22, 2007 Author Share Posted August 22, 2007 when the code runs after the user logs in all i get is a white page, i need it to show the datesoff.php and the deletedates.php and it does not think my include statements are worng Quote Link to comment Share on other sites More sharing options...
fenway Posted August 23, 2007 Share Posted August 23, 2007 A white page? Sounds like a php error. 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.