Guest User

Untitled

a guest
Nov 10th, 2013
352
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 3.71 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>GTA V Mission Info - Database Insert</title>
  4. </head>
  5. <body>
  6. <?php
  7.            //Variables for connecting to your database.
  8.            //These variable values come from your hosting account.
  9.            $hostname = "HIDDEN";
  10.            $username = "HIDDEN";
  11.            $dbname = "GTAVMissions";
  12.  
  13.            //These variable values need to be changed by you before deploying
  14.            $password = "HIDDEN";
  15.            $usertable = "Missions";
  16.        
  17.            //Connecting to your database
  18.            mysql_connect($hostname, $username, $password) OR DIE ("Unable to
  19.            connect to database! Please try again later.");
  20.            mysql_select_db($dbname);
  21.  
  22.         $MissionName=$_POST['MissionName'];
  23.            $Contact=$_POST['Contact'];
  24.            $Rank=$_POST['Rank'];
  25.            $CashPayout=$_POST['CashPayout'];
  26.            $RPPayout=$_POST['RPPayout'];
  27.            $MinPlayers=$_POST['MinPlayers'];
  28.         $MaxPlayers=$_POST['MaxPlayers'];
  29.            $Desc=$_POST['Desc'];
  30.            $Tips=$_POST['Tips'];
  31.  
  32.     if(isset($_GET['process']))
  33.     {
  34.         $query = "INSERT INTO `Missions` (MissionName, Contact, Rank, CashPayout, RPPayout, MinPlayers, MaxPlayers, Desc, Tips) VALUES ('$MissionName', '$Contact', '$Rank', '$CashPayout', '$RPPayout', '$MinPlayers', '$MaxPlayers', '$Desc', '$Tips')";
  35.         //echo $query; exit;
  36.         $result = mysql_query($query) or die(mysql_error());
  37.         if(!$result)
  38.         {
  39.         $msg = "Failed to add mission to database. Please check your information and try again.";
  40.         }
  41.         else
  42.         {
  43.         $msg = "Successfully added mission to database!";
  44.         header("location:ClientList.php?m=".$msg);
  45.         }
  46.     }
  47. ?>
  48.  
  49. <table width="700" border="1">
  50. <form id="MissionForm" name="MissionForm" method="post" action="insert.php?process">
  51.   <tr>
  52.     <td>Mission Name</td>
  53.     <td><label>
  54.  
  55.       <input name="MissionName" type="text" id="MissionName" />
  56.     </label></td>
  57.   </tr>
  58.   <tr>
  59.     <td>Contact</td>
  60.     <td>
  61.       <label width=100%>
  62.         <select name="Contact" type="text" id="Contact">
  63.         <option value="Gerald">Gerald</option>
  64.         <option value="Lamar">Lamar</option>
  65.         <option value="Lester">Lester</option>
  66.         <option value="Martin">Martin</option>
  67.         <option value="Ron">Ron</option>
  68.         <option value="Simeon">Simeon</option>
  69.         <option value="Trevor">Trevor</option>
  70.     </select>
  71.         </label>
  72.         </td>
  73.   </tr>
  74.   <tr>
  75.     <td>Rank Required</td>
  76.     <td>
  77.       <label>
  78.         <input name="Rank" type="text" id="Rank" />
  79.         </label>
  80.         </td>
  81.   </tr>
  82.   <tr>
  83.     <td>Cash Payout (After First Attempt)</td>
  84.     <td>
  85.       <label>
  86.       $<input name="CashPayout" type="text" id="CashPayout" />
  87.       </label>
  88.         </td>
  89.   </tr>
  90.   <tr>
  91.     <td>Base RP Payout</td>
  92.     <td>
  93.       <label>
  94.         <input name="RPPayout" type="text" id="RPPayout" />
  95.         </label>
  96.        </td>
  97.   </tr>
  98.   <tr>
  99.     <td>Minimun Players</td>
  100.     <td>
  101.       <label>
  102.         <input name="MinPlayers" type="text" id="MinPlayers" />
  103.         </label>
  104.         </td>
  105.   </tr>
  106.   <tr>
  107.     <td>Maximun Players</td>
  108.     <td>
  109.       <label>
  110.         <input name="MaxPlayers" type="text" id="MaxPlayers" />
  111.         </label>
  112.         </td>
  113.   </tr>
  114. <tr>
  115.     <td>Mission Description</td>
  116.     <td>
  117.       <label>
  118.         <input name="Desc" type="text" id="Desc" />
  119.         </label>
  120.         </td>
  121.   </tr>
  122.   <tr>
  123.     <td>Mission Tips</td>
  124.     <td>
  125.       <label>
  126.         <input name="Tips" type="text" id="Tips" />
  127.         </label>
  128.         </td>
  129.   </tr>
  130.   <tr>
  131.     <td>
  132.       <label>
  133.       <input type="submit" name="Submit" value="Submit" />
  134.         </label>
  135.     </form>    </td>
  136.   </tr>
  137. </table>
  138. </body>
  139. </html>
Advertisement
Add Comment
Please, Sign In to add comment