OK I have a table in the database (boyem) called "amx_regusers".
In that table there are 4 fields fileds are as fallows:
nick, pass, flags, aflags
Well I have created a HTML page here is the html page.
regusers.html
<html>
<head>
<title>Nick Registration</title>
<link href="csss.css" rel="stylesheet" type="text/css">
</head>
<body>
<h1>Registering Names and Clans</h1>
<form action="insert_player.php" method="post">
<table border="0">
<tr>
<td width="103"><font color="#000000" face="Geneva, Arial, Helvetica, sans-serif"><strong>Nick</strong></font></td>
<td width="271"><input type="text" name="nick" maxlength="30" size="13">
<br /></td>
</tr>
<tr>
<td><font face="Geneva, Arial, Helvetica, sans-serif"><strong>Pass</strong></font></td>
<td> <input type="text" name="pass" maxlength="10" size="10">
<br /></td>
</tr>
<tr>
<td><font face="Geneva, Verdana, Georgia"><strong>Flag</strong></font></td>
<td> <input type="text" name="flags" maxlength="20" size="20">
<br></td>
</tr>
<tr>
<td height="75"><font size="3" face="Geneva, Verdana, Georgia"><strong>Access Flags</strong></font></td>
<td><input type="text" name="aflags" maxlength="50" size="50">
<br /></td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="Register"></td>
</tr>
</table>
</form>
</body>
</html>
and I also created insert_player.php that will make the database connection
<html>
<head>
<title>Player Registration</title>
</head>
<body>
<h1>Player Registration Results</h1>
<?php
// create short variable names
$nick=$HTTP_POST_VARS['nick'];
$pass=$HTTP_POST_VARS['pass'];
$flags=$HTTP_POST_VARS['flags'];
$aflags=$HTTP_POST_VARS['aflags'];
if (!$nick || !$pass || !$flags || !$aflags)
{
echo 'You have not entered all the required details.<br />'
.'Please go back and try again.';
exit;
}
$nick = addslashes($nick);
$pass = addslashes($pass);
$flags = addslashes($flags);
$aflags = addslashes($aflags);
@ $db = mysql_pconnect('localhost', 'boyem', 'password', 'boyem_com');
if (!$db)
{
echo 'Error: Could not connect to database. Please try again later.';
exit;
}
mysql_select_db('boyem_com');
$query = "insert into amx_regusers values
('".$nick."', '".$pass."', '".$flags."', '".$aflags."')";
$result = mysql_query($query);
if ($result)
echo mysql_affected_rows().' Player inserted into database.';
?>
</body>
</html>
first of all in the web page after I click on Register it doesn't tell me the next page "Player inserted into database" it just gives me a emty page with the Player Registration header...
also when I look at my database if it inserted correctly I see nothing inserted.....
what is wrong with my code???
PS in my amx_regusers table there are other fields here is the total fields...
id nick pass flags aflags lastus ipaddr
but id, lastus, and ipaddr are entered atutomatically do you think that is the problem or I have seomthing missing in the code...
thanks in advance