Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <?php
  3. //connect to database
  4. @ $db= new mysqli('localhost','root','','assignment1');
  5. if (mysqli_connect_error())
  6. {//display the details of any connection errors
  7. echo 'Error connecting to database:<br/>'.mysqli_connect_error();
  8. exit;
  9. }
  10. ?>
  11. <html>
  12. <head>
  13. <title>Increase Duration Page</title>
  14.  
  15. <script language="JavaScript" type="text/javascript">
  16. function ValidateForm()
  17. {
  18. //validate for Duration
  19. if (document.newEventDuration.Duration.value == '')
  20. {
  21. alert('Duration field cannot be blank.');
  22. document.newEventDuration.Duration.focus();
  23. return false;
  24. }
  25. ///Tests if the Duration have the length from 3 to 12
  26. if (document.newEventDuration.value.length <=3) && (document.newEventDuration.value.length >=12)
  27. {
  28. alert('Duration value must be from 3 to 12 ');
  29. document.newEventDuration.Duration.focus();
  30. return false;
  31. }
  32.  
  33. }
  34. </script>
  35. </head>
  36.  
  37. <body>
  38. <?php
  39.  
  40. ?>
  41. <form name="newEventDuration" method="post" action="increasedu.php" onsubmit="return ValidateForm();">
  42. <table style="width: 300px; border: 0px;" cellspacing="1" cellpadding="1">
  43. <tr>
  44. <td colspan="2"><strong>Event Duration</strong></td>
  45. </tr>
  46. <tr style="background-color: #FFFFFF;">
  47. <td>Length Event Duration</td>
  48. <td>
  49. <input name="Duration" type="text" style="width: 50px;" maxlength="2" />*</td>
  50. </tr>
  51.  
  52. <tr style="background-color: #FFFFFF;">
  53. <td>
  54. <input type="submit" name="submit" value="Submit" /></td>
  55. </tr>
  56. </table>
  57. <br>
  58. <!--<button onclick="goBack()">Go Back</button>-->
  59. <a href="http://localhost:2431/csg2431/Assignment/VolunteerTimeSlots.php">Back</a>
  60. <?php echo '<p><a href="logout.php">Log Out</a></p>'; ?>
  61. </form>
  62. </body>
  63. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement