I have a form, and some code.
and i want to add all information from the form in to the database.
when i press submit now, it gathers all information and puts it in to the url after the registrate.php?=all form info here.
But it doesnt add it to the database.
Here is the code:
<?
$ip = getenv('REMOTE_ADDR');
$time = date('D M j');
if(isset($_GET['commented']))
{
// Tell the user it has been submitted (optional)
echo('Your clan has been registrated.');
// Set Mysql Variables
$host = 'localhost';
$user = 'XXXXX';
$pass = 'XXXXX';
$db = 'XXXXX';
$table = 'registrated';
// Set global variables to easier names
$cname = $_GET['cname'];
$ctag = $_GET['ctag'];
$game = $_GET['game'];
$level = $_GET['level'];
$cleader = $_GET['cleader'];
$members = $_GET['members'];
$irc = $_GET['irc'];
$website = $_GET['website'];
// Connect to Mysql, select the correct database, and run teh query which adds the data gathered from the form into the database
mysql_connect($host,$user,$pass) or die(mysql_error());
mysql_select_db($db) or die(mysql_error());
$add_all = 'INSERT INTO '.$table.' values(\''.$ip.'\',\''.$cname.'\',\''.$ctag.'\',\''.$game.'\',\''.$level.'\',\''.$cleader.'\',\''.$members.'\',\''.$irc.'\',\''.$website.'\',\'\')';
mysql_query($add_all) or die(mysql_error());
}
else
{
// If the form has not been submitted, display it!
?>
<form method= 'get' action="registrate.php" >
<p><strong>Fill in all fiels, if fields are missing you will not
be participating in the sweCUP</strong></p>
<p><strong>If you dont have an IRC channel, you will not be participating
in the sweCUP</strong></p>
<table width="100%%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Clan name</td>
<td><input type="text" name="cname"></td>
</tr>
<tr>
<td>clan tag</td>
<td><input type="text" name="ctag"></td>
</tr>
<tr>
<td>game to participate in</td>
<td><select name="game">
<option value="RTCW">RTCW</option>
<option value="ET">ET</option>
</select></td>
</tr>
<tr>
<td>level of skill</td>
<td><select name="level">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
</select></td>
</tr>
<tr>
<td>clanleader</td>
<td><input type="text" name="cleader"></td>
</tr>
<tr>
<td valign="top">Members: (names) <strong>(press enter after
a name)</strong></td>
<td><textarea name="members" rows="12"></textarea> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td height="20">irc channel<strong> ( must have! )</strong></td>
<td><input type="text" name="irc"></td>
</tr>
<tr>
<td>website</td>
<td><input type="text" name="website"></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit" value="Submit"></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
</form>
<?
}
?>
What am i doing wrong