Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 8th, 2012  |  syntax: None  |  size: 1.15 KB  |  hits: 7  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <link rel="stylesheet" type="text/css" href="src/css/main.css">
  2.  
  3. <?php
  4.  
  5. //Declare variables to be read in by HTML
  6.  
  7. $jobAuth =$_POST["jobAuth"];
  8.  
  9.  
  10. //Connecting to server
  11. $con = mysql_connect("localhost", "x", "x");
  12. mysql_select_db("projectdb", $con);
  13.  
  14.  if (mysqli_connect_errno()) {
  15.      echo 'Error: Could not connect to database.  Please try again later.';
  16.      exit;
  17.   }
  18.  
  19.  
  20.  
  21. //DB selected
  22.  
  23.  
  24.  
  25. $query = "SELECT * FROM JOBAUTHS WHERE JobAuthID = '$jobAuth' and startDate <= curdate() and endDate >= curdate();";
  26. $result = mysql_query($query) or die ("".mysql_error());
  27.  
  28.  
  29. if (mysql_num_rows($result)==0){
  30. echo "<p align='center'>No valid Job Authorization matches that number.</p>";
  31. echo "<br />";
  32. echo "<p align='left'>Click \"Back\" and be sure you entered the Job Authorization Number correctly.</p>";
  33. echo "<br />";
  34. 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>";
  35. }
  36.  
  37. else {
  38.         include("insertEvent.php?jobAuth=$jobAuth");
  39.      }
  40.  
  41.  
  42.  
  43.  
  44. //Close connection
  45. mysql_close($con);
  46.  
  47.  
  48.  
  49. ?>