
Untitled
By: a guest on
May 8th, 2012 | syntax:
None | size: 1.15 KB | hits: 7 | expires: Never
<link rel="stylesheet" type="text/css" href="src/css/main.css">
<?php
//Declare variables to be read in by HTML
$jobAuth =$_POST["jobAuth"];
//Connecting to server
$con = mysql_connect("localhost", "x", "x");
mysql_select_db("projectdb", $con);
if (mysqli_connect_errno()) {
echo 'Error: Could not connect to database. Please try again later.';
exit;
}
//DB selected
$query = "SELECT * FROM JOBAUTHS WHERE JobAuthID = '$jobAuth' and startDate <= curdate() and endDate >= curdate();";
$result = mysql_query($query) or die ("".mysql_error());
if (mysql_num_rows($result)==0){
echo "<p align='center'>No valid Job Authorization matches that number.</p>";
echo "<br />";
echo "<p align='left'>Click \"Back\" and be sure you entered the Job Authorization Number correctly.</p>";
echo "<br />";
echo "<p align='left'>If you are sure you entered the Job Authorization Number correctly and are still getting this error, contact the contractor's supervisor for the correct job code.</p>";
}
else {
include("insertEvent.php?jobAuth=$jobAuth");
}
//Close connection
mysql_close($con);
?>