This is part of a billing software i am creating.
This file's permissions are set to 644 and I uploaded it via SCP. I logged in via SSH to make sure the file contents were written correctly. (and they were)
Whenever i try to open the script in my browser it shows up blank. There is no content. My system administrator assures me its nothing on the server and its something with this code. I think he is right because i tried echoing a hello world it shows up correctly. When i move the contents of this file to a new file, it shows up blank still. What is wrong with this script that is causing it to not show up in my browser?
Thanks!
PHP Code:
<?php // Connects to your Database require("../libraries/db/dbconnect.php"); //checks cookies to make sure they are logged in if(isset($_COOKIE['ID_my_site'])) { $username = $_COOKIE['ID_my_site']; $pass = $_COOKIE['Key_my_site']; $check = mysql_query("SELECT * FROM users WHERE username = '$username'")or die(mysql_error()); while($info = mysql_fetch_array( $check )) { //if the cookie has the wrong password, they are taken to the login page if ($pass != $info['password']) { header("Location: login.php"); } //otherwise they are shown the admin area
else { // Include Header include("template/header.php"); // begin page content ?> <script type="text/javascript"> // RAI Confirm Payments Javascript // (C) 2010 DJAB Networks
var raicid; function RAIConfirm(raicid) { window.location = "confirmpayments_process.php?pid=" + raicid; } var raieid; function RAIEdit(raieid) { window.location = "confirmpayments_edit.php?pid=" + raieid; } </script> <?php //SQL Query for the first while loop $sql1 = mysql_query("SELECT * FROM payroll where confirmed = '0' ORDER BY PID ASC"); //If user has no payrolls if (mysql_num_rows($sql1) == 0) { echo "No past payments available"; include("template/footer.php"); exit; } // Open our table up echo "<table align=\"center\" width=\"700\">\r\n";
//First while loop while($row = mysql_fetch_array($sql1)) { //Show who submitted this payroll request $user_Name = $row['username']; $name = mysql_result(mysql_query("select name from users where username = '$user_Name'"), 0); echo "<tr><td></td><td><b>Name</b></td><td><b>".$name."</b></td>\r\n"; echo "<td><input type=\"button\" name=\"button-confirm-".$row['PID']."\" value=\"Confirm »\" onclick=\"RAIConfirm('".$row['PID']."');\" /><br /><input type=\"button\" name=\"button-edit-".$row['PID']."\" value=\"Edit »\" onclick=\"RAIEdit('".$row['PID']."');\" /></td></tr>"; echo "<tr><td></td><td></td><td></td></tr>"; // Configure the columns of the table echo "<tr><td></td><td><strong>Unit</strong></td><td><strong>Rate</strong></td><td><strong>Total</strong></td></tr>\r\n"; // Table is opened. Let's bring in our Timestamp: // We'll put this on hold for now - echo "<tr><td>Timestamp</td><td>".$row2['timestamp']."</td><td><i>N/A</i></td></tr>"; // Bring in our variables now //SQL Query for the second while loop $sql2 = mysql_query("SELECT * FROM vars ORDER BY ID ASC"); while($row2 = mysql_fetch_array($sql2)) { // Determine variables $varName = $row2['varName']; $aliasName = $row2['varAlias']; $aliasRate = $row2['varAlias']."_rate"; $varTotal = $row[$aliasName] * $row[$aliasRate]; $subTotal = $row['subTotal']; $total = $row['total']; // Parse into table echo "<tr><td>".$varName."</td><td>".$row[$aliasName]."</td><td>$".$row[$aliasRate]."</td><td>$".$varTotal."</td></tr>\r\n"; } // Begin swaps $swaps = mysql_result(mysql_query("select amount from swaps where PID = ".$row['PID'].""),0); echo "<tr></tr><tr><td>Swaps</td><td></td><td></td><td>".$swaps."</td></tr>\r\n"; // Begin Reimbursements $remTotal = mysql_result(mysql_query("select total from reimbursements where PID = ".$row['PID'].""),0); echo "<tr></tr><tr><td><b>Reimbursements</b></td><td></td><td></td><td>$" . $remTotal . "</td></tr>\r\n"; $sql3 = mysql_query("select * from rems order by ID asc"); while($row3 = mysql_fetch_array($sql3)) { $remName = $row3['remName']; $remAlias = $row3['remAlias']; $varTotal = mysql_result(mysql_query("select ".$remAlias." from reimbursements where PID = '".$row['PID']."'"),0); echo "<tr><td>".$remName."</td><td></td><td></td><td>$".$varTotal."</td></tr>\r\n"; } //Begin Taxes $taxesTotal = mysql_result(mysql_query("select total from taxrecords where PID = ".$row['PID'].""),0); echo "<tr></tr><tr><td><b>Taxes</b></td><td></td><td></td><td>$" . $taxesTotal . "</td></tr>\r\n"; $sql4 = mysql_query("select * from taxes order by ID asc"); while($row4 = mysql_fetch_array($sql4)) { $taxName = $row4['taxName']; $taxAlias = $row4['taxAlias']; $taxNameRate = $taxName . "_rate"; $varTotal = mysql_result(mysql_query("select ".$taxAlias." from taxrecords where PID = '".$row['PID']."'"),0); $taxRate = mysql_result(mysql_query("select ".$taxNameRate." from taxrecords where PID = ".$row['PID'].""),0); $taxTotal = $taxRate * $varTotal; echo "<tr><td>".$taxName."</td><td>".$varTotal."</td><td>".$taxRate."</td><td>$".$taxTotal."</td></tr>\r\n"; } } echo "<tr><td><strong>Sub Total</strong></td><td><strong>$".$subTotal."</strong></td><td></td></tr>"; //Taxes will load here echo "<tr><td><strong>Total</strong></td><td><strong>$".$total."</strong></td><td></td></tr>"; echo "<tr><td></td><td></td><td></td></tr>"; echo "<tr><td></td><td></td><td></td></tr>"; echo "<tr><td></td><td></td><td></td></tr>"; echo "<tr><td></td><td></td><td></td></tr>"; } // End table echo "</table>\r\n"; // Footer Template //end page content } } } else //if the cookie does not exist, they are taken to the login screen { header("Location: login.php"); } include("template/footer.php"); ?>
Last edited by djab; 03-19-2011 at 08:42 PM..
|