Advertisement
gitlez

YA: Rewrite of a script $nms

Jul 6th, 2012
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.95 KB | None | 0 0
  1. <?php
  2. $con = mysql_connect("localhost","root") or die( 'Error Connecting: ' . mysql_error() );
  3. mysql_select_db("test",$con) or die( 'Couldn\'t Select Database. ' . mysql_error());
  4. $request= "SELECT company FROM company";
  5. $query_result = mysql_query($request);
  6. if( !$query_result ){
  7.     die('Query Failed. ' . mysql_error( $con ));
  8. }
  9. $companySelects = '';
  10. while($result= mysql_fetch_assoc($query_result)) {
  11.  $companySelects .= '<option value="' . $result['company'] . '">' . $result['company'] . '</option>' . PHP_EOL;
  12. }
  13. ?>
  14. <html>
  15.     <head>
  16.     </head>
  17. <body>
  18.     <form action="post" method="">
  19.         Firstname:<input type="text" name="firstname" size="30">
  20.         <br>
  21.         <br>
  22.         Surname:<input type="text" name="surname" size="30">
  23.         <br>
  24.         <br>
  25.         E-mail Address: <input type="text" name="email" size="60">
  26.         <br>
  27.         <br>
  28.         Company of Interest:
  29.         <select name="organizations">
  30.             <option value="" selected="selected" > Select Company </option>
  31.             <?php echo $companySelects; ?>
  32.         </select>
  33.         <br>
  34.         <br>
  35.  
  36.  
  37.         Select Major:<br>
  38.         <input type="radio" name="course" value="softwareEngineering"> Software Engineering        <br>
  39.         <br>
  40.         <input type="radio" name="course" value="networkEngineering"> Network Engineering        <br>
  41.         <br>
  42.         <input type="radio" name="course" value="businessInfoSys"> Business Information systems        <br>
  43.         <br>
  44.         Application Letter:         <br>
  45.         <br>
  46.         <textarea name="letter" rows="15" cols="60" ></textarea>
  47.                 <br>
  48.         <br>
  49.         Other Attachments:
  50.         Curriculum Vitae:<input type="file" name="cv" size="30">
  51.         Reccomendation: <input type="file" name="recommend" size="30">
  52.         <input type="submit" name="submit" value="Apply">
  53.         <input type="reset" name="reset" value="Clear Form">
  54.     </form>
  55. </body>
  56. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement