rendered paste body <?php
include("dbconnect.php");//include the file that connects to the database
if(!empty($name)) {//if the name is not empty, than do this function
$name = addslashes($name);
$age = addslashes($age);
$sex = addslashes($sex);
$country = addslashes($country);
$status = addslashes($status);
$game = addslashes($game);
$website = addslashes($website);
$xfire = addslashes($xfire);
$biography = addslashes($biography);
$manufacturer = addslashes($manufacturer);
$os = addslashes($os);
$cpu = addslashes($cpu);
$memory = addslashes($memory);
$harddrive = addslashes($harddrive);
$videocard = addslashes($videocard);
$soundcard = addslashes($soundcard);
$headphones = addslashes($headphones);
$monitor = addslashes($monitor);
$mouse = addslashes($mouse);
$mousepad = addslashes($mousepad);
$keyboard = addslashes($keyboard);
$gamingname = addslashes($gamingname);
$sql = "INSERT INTO members (id, name, age, sex, country, status, game, website, xfire, biography, manufacturer, os, cpu, memory, harddrive, videocard, soundcard, headphones, monitor, mouse, mousepad, keyboard, gamingname) VALUES ('NULL','$name','$age','$sex','$country','$status','$game','$website','$xfire','$biography','$manufacturer','$os','$cpu','$memory','$harddrive','$videocard','$soundcard','$headphones','$monitor','$mouse','$mousepad','$keyboard','$gamingname')";
$query = mysql_query($sql) or die("Cannot query the database.<br>" . mysql_error());
echo "Database Updated.";
} else {//However, if the title variable is empty, than do this function
?>
<style type="text/css">
<!--
.style1 {
font-family: tahoma, verdana;
font-size: 11px;
}
.style2 {font-family: tahoma, verdana; font-size: 11px; font-weight: bold; }
.style3 {color: #333333}
-->
</style>
<form name="members" method="post" action="<?php echo $PHP_SELF; ?>">
<p class="style2">Please fill out all of the following fields:</p>
<table width="100%" border="0" cellpadding="5" cellspacing="0">
<tr>
<td width="117" class="style1">Gaming Name*:</td>
<td width="577" class="style1">
<input name="gamingname" type="text" size="20" value="<?php if(isset($_POST['gamingname'])) echo $_POST['gamingname']; ?>"></td>
</tr>
<tr>
<td width="117" class="style1">Name*:</td>
<td width="577" class="style1">
<input name="name" type="text" size="20" value="<?php if(isset($_POST['name'])) echo $_POST['name']; ?>"></td>
</tr>
<tr>
<td width="117" class="style1">Age*:</td>
<td width="577" class="style1">
<input name="age" type="text" size="2" value="<?php if(isset($_POST['age'])) echo $_POST['age']; ?>"></td>
</tr>
<tr>
<td width="117" class="style1">Sex*:</td>
<td width="577" class="style1"><label>
<select name="sex">
<option value="<?php if(isset($_POST['sex'])) echo $_POST['sex']; ?>" selected="selected">Male</option>
<option value="<?php if(isset($_POST['sex'])) echo $_POST['sex']; ?>">Female</option>
</select>
</label></td>
</tr>
<tr>
<td width="117" class="style1">country*:</td>
<td width="577" class="style1"><label>
<select name="country">
<option value="<?php if(isset($_POST['country'])) echo $_POST['country']; ?>">Canada</option>
<option value="<?php if(isset($_POST['country'])) echo $_POST['country']; ?>" selected="selected">United States of America</option>
</select>
</label></td>
</tr>
<tr>
<td width="117" class="style1">status*:</td>
<td width="577" class="style1"><label>
<select name="status">
<option value="<?php if(isset($_POST['status'])) echo $_POST['status']; ?>" selected="selected">Active</option>
<option value="<?php if(isset($_POST['status'])) echo $_POST['status']; ?>">InActive</option>
</select>
</label></td>
</tr>
<tr>
<td width="117" class="style1">game*:</td>
<td width="577" class="style1"><label>
<select name="game">
<option value="<?php if(isset($_POST['game'])) echo $_POST['game']; ?>" selected="selected">Counter Strike: Source</option>
<option value="<?php if(isset($_POST['game'])) echo $_POST['game']; ?>">Unreal Tounranment 2004</option>
</select>
</label></td>
</tr>
<tr>
<td width="117" class="style1">website*:</td>
<td width="577" class="style1"><input name="website" type="text" size="20" value="<?php if(isset($_POST['website'])) echo $_POST['website']; ?>" /></td>
</tr>
<tr>
<td width="117" class="style1">xfire*:</td>
<td width="577" class="style1">
<input name="xfire" type="text" value="<?php if(isset($_POST['website'])) echo $_POST['xfire']; ?>" size="15"></td>
</tr>
<tr>
<td width="117" class="style1">Biography*:</td>
<td width="577" class="style1">
<span class="style3">
<textarea name="biography" rows=10 cols=43> <?php if(isset($_POST['biography'])) echo $_POST['biography']; ?></textarea>
</span> </td>
</tr>
<tr>
<td width="117" class="style1">Manufacturer*:</td>
<td width="577" class="style1">
<input name="manufacturer" value="<?php if(isset($_POST['manufacturer'])) echo $_POST['manufacturer']; ?>" type="text" size="15" ></td>
</tr>
<tr>
<td width="117" class="style1">Operating System*:</td>
<td width="577" class="style1">
<input name="os" type="text" size="10" value="<?php if(isset($_POST['os'])) echo $_POST['os']; ?>" type="text" size="15"></td>
</tr>
<tr>
<td width="117" class="style1">CPU*:</td>
<td width="577" class="style1">
<input name="cpu" value="<?php if(isset($_POST['cpu'])) echo $_POST['cpu']; ?>" type="text" size="15" type="text" size="10"></td>
</tr>
<tr>
<td width="117" class="style1">Memory*:</td>
<td width="577" class="style1">
<input name="memory" value="<?php if(isset($_POST['memory'])) echo $_POST['memory']; ?>" type="text" size="10"></td>
</tr>
<tr>
<td width="117" class="style1">Harddrive*:</td>
<td width="577" class="style1">
<input name="harddrive" value="<?php if(isset($_POST['harddrive'])) echo $_POST['harddrive']; ?>" type="text" size="10"></td>
</tr>
<tr>
<td width="117" class="style1">Video card*:</td>
<td width="577" class="style1">
<input name="videocard" value="<?php if(isset($_POST['videocard'])) echo $_POST['videocard']; ?>" type="text" size="10"></td>
</tr>
<tr>
<td width="117" class="style1">Sound card*:</td>
<td width="577" class="style1">
<input name="soundcard" value="<?php if(isset($_POST['soundcard'])) echo $_POST['soundcard']; ?>" type="text" size="10"></td>
</tr>
<tr>
<td width="117" class="style1">Headphones*:</td>
<td width="577" class="style1">
<input name="headphones" value="<?php if(isset($_POST['headphones'])) echo $_POST['headphones']; ?>" type="text" size="10"></td>
</tr>
<tr>
<td width="117" class="style1">Monitor*:</td>
<td width="577" class="style1">
<input name="monitor" value="<?php if(isset($_POST['monitor'])) echo $_POST['monitor']; ?>" type="text" size="10"></td>
</tr>
<tr>
<td width="117" class="style1">mouse*:</td>
<td width="577" class="style1">
<input name="mouse" value="<?php if(isset($_POST['mouse'])) echo $_POST['mouse']; ?>" type="text" size="10"></td>
</tr>
<tr>
<td width="117" class="style1">mouse pad*:</td>
<td width="577" class="style1">
<input name="mousepad" value="<?php if(isset($_POST['mousepad'])) echo $_POST['mousepad']; ?>" type="text" size="10"></td>
</tr>
<tr>
<td width="117" class="style1">key board*:</td>
<td width="577" class="style1">
<input name="keyboard" value="<?php if(isset($_POST['keyboard'])) echo $_POST['keyboard']; ?>" type="text" size="10"></td>
</tr>
</table>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form> <?php
}//end this function
?>