Advertisement
Guest User

Untitled

a guest
Jun 18th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 3.03 KB | None | 0 0
  1. <!--////////////////////////////////////////////BEGINING////////////////////////////////////////////////-->
  2.  
  3. <form action="" method="post">
  4. <table class="table">
  5. <tr>
  6.  
  7. <!--////////////////////////////////////////////ENTRY////////////////////////////////////////////////-->
  8. <td style="width: 25%;">
  9.     <table class="table" style="width: 100%;">
  10.         <tr>
  11.             <td align="center">Name:</td>
  12.             <td align="center"><input type="text" name="name" required></td>
  13.         </tr>
  14.         <tr>
  15.             <td align="center">CCP License #:</td>
  16.             <td align="center"><input type="text" name="notes"></td>
  17.         </tr>
  18.     </table>
  19. </td>
  20. <!--////////////////////////////////////////////ITEMS////////////////////////////////////////////////-->
  21. <td style="width: 25%;">
  22.     <table class="table" style="width: 100%;">
  23.         <tr>
  24.         <td colspan="11" align="center" style="color: #f1592b;font-size: 17px;font-weight: bold;">Weapon</td>
  25.         </tr>
  26.         <tr>  
  27.             <td align="center">Type</td>  
  28.             <td align="center"><select name="item[]">
  29.             <option value=""></option>
  30.                 <option value="P07 Pistol, ">P07 Pistol</option>
  31.                 <option value="P07 Pistol (Khaki), ">P07 Pistol (Khaki)</option>
  32.                 <option value="PM 9mm Pistol, ">PM 9mm Pistol</option>
  33.                 <option value="ACP Pistol, ">ACP Pistol</option>
  34.                 <option value="4-five .45 Pistol , ">4-five .45 Pistol </option>
  35.                 <option value="Rook-40 Pistol, ">Rook-40 Pistol</option>
  36.                 <option value="Zubr Pistol , ">Zubr Pistol </option>
  37.                 <option value="Signal/Flare/Starter Pistol, ">Signal/Flare/Starter Pistol</option>
  38.             </select></td>
  39.         </tr>
  40.     </table>
  41. </td>
  42. <!--/////////////////////////////////////////SUBMIT///////////////////////////////////////////////////-->
  43.     <tr>
  44.         <td colspan="4" align="left"><input type="submit" value="submit" name="sub"></td>
  45.     </tr>
  46. <!--/////////////////////////////////////////ENDING///////////////////////////////////////////////////-->
  47. </tr>
  48. </table>
  49. </form>
  50.     <?php  
  51.    if(isset($_POST['sub']))  
  52.    {
  53.     $oldname="";
  54.     $servername = "localhost";
  55.     $username = "";
  56.     $password = "";
  57.     $dbname = "";
  58.    
  59.     $con = new mysqli($servername, $username, $password, $dbname);
  60.     if ($con->connect_error) {
  61.         die("Connection failed: " . $conn->connect_error);
  62.     }
  63.     if ($_POST["name"] != $oldname)
  64.     {  
  65.         foreach ($_POST['item'] as $select)
  66.         {
  67.         $chk .= $select."";  
  68.         }
  69.             $in_ch1=mysqli_query($con,"INSERT INTO orders (faction, name, items, filled, notes) VALUES (
  70.                 'CCP',
  71.                 '".$_POST['name']."',
  72.                 '$chk',
  73.                 'No',
  74.                 '".$_POST['notes']."'
  75.                 )");
  76.             if($in_ch1>=1)  
  77.                {  
  78.                   echo '<div class="alert alert-success">Successfully submitted order, redirecting...</div><meta http-equiv="refresh" content="1;url=../home">';
  79.                }  
  80.             else  
  81.                {  
  82.                   echo '<div class="alert alert-warning">Failed to submit order, redirecting...</div><meta http-equiv="refresh" content="1;url=../home">';
  83.                }  
  84.     }
  85.     else echo '<div class="alert alert-warning">Failed to submit order, redirecting...</div><meta http-equiv="refresh" content="1;url=../home">';
  86. }  
  87.     $con->close();
  88. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement