The following code only works when named index.php.
If I name it anything else (eg: logon) won't post to the db and trys to locate index.php.
Been looking at the code for 2 hours and can't find the fault, is it possible its a apache server issue ?
Please help... I need some sleep .
<?php
require ($_SERVER["DOCUMENT_ROOT"]."/pickup/config/rav_config_db.php");
$connection = mysql_connect($db_host, $db_user, $db_password) or die("fucked up try again");
mysql_select_db($db_name, $connection);
$username = $_POST[username];
$result = mysql_query("SELECT * FROM user where username = '$username'");
if (strlen($username) != 0)
if (mysql_num_rows($result) > 0 )
{
die ("user name already exists in database, or you may have left it blank please use the back button and try again");
}
$wonid = $_POST[wonid];
$result = mysql_query("SELECT * FROM user where wonid = '$wonid'");
if (strlen($wonid) != 0)
if (mysql_num_rows($result) > 0 )
{
die ("The WONID already exists in the database go purchase you own copy of Half life you haxor or read the instructions and enter one and try again using the back button");
}
$gname = $_POST[gname];
$result = mysql_query("SELECT * FROM user where gname = '$gname'");
if (strlen($gname) != 0)
if (mysql_num_rows($result) > 0 )
{
die ("That name is either in use or you have not entered one");
}
$email = $_POST[email];
$result = mysql_query("SELECT * FROM user where email = '$email'");
if (strlen($email) != 0)
if (mysql_num_rows($result) > 0 )
{
die ("That email address is either in use or you have not botherd to enter one, use the back button");
}
else
{
$password = $_POST[password];
$clan = $_POST[clan];
$query = "INSERT INTO user (username, wonid, password, gname, email, clan) Values ('$username', '$wonid', '$password', '$gname', '$email', '$clan')";
$result= mysql_query($query, $connection);
if($result)
{
echo "Your details have been added to our records, you can now /msg cspickup-bot AUTH user pass";
exit();
}
else
{
echo "There was a problem with our database. Please try again later.";
exit();
}
}
?>
<html>
<head><title>AoN Pickup Sign On</title></Head>
<body bgcolor="#333333">
</body>
</html>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%">
<tr>
<td width="100%">
<p align="center">
<img border="0" src="logo.gif" width="340" height="89"><br>
</td>
</tr>
<tr>
<td width="100%">
<html>
<body bgcolor="#333333">
<form action="<?php echo $_server[php_self]; ?> "Method="POST">
<center>
<TABLE border="0" style="border-collapse: collapse" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2">
<p align="center"> </td>
</tr>
<tr>
<td>
<font color="#B2B2AD"><b>Username:</b> </font>
</td>
<td>
<font color="#FFFFCC">
<input type="username" name="username" size="20"> </font>
</TR>
</tr>
<TR>
<td>
<font color="#B2B2AD">
<B>Password:</B> </font>
</td>
<td>
<font color="#FFFFCC">
<input type="password" name="password" size="20"> </font>
</TR>
<TR>
<td>
<font color="#B2B2AD"><b>CS Name:</b> </font>
</td>
<td>
<font color="#FFFFCC">
<input type="gname" name="gname" size="20"> </font>
</TR>
<TR>
<td>
<font color="#B2B2AD">
<B>Wonid:</B> </font>
</td>
<td>
<font color="#FFFFCC">
<input type="wonid" name="wonid" size="20"> </font>
</TR>
<TR>
<td>
<font color="#B2B2AD">
<B>Email:</B> </font>
</td>
<td>
<font color="#FFFFCC">
<input type="email" name="email" size="20"> </font>
</TR>
<TR>
<td>
<font color="#B2B2AD">
<B>Clan:</B> </font>
</td>
<td>
<font color="#FFFFCC">
<input type="clan" name="clan" size="20"> </font>
</TR>
<tr>
<td>
</td>
<td>
<font color="#FFFFCC">
<input type="submit" value="submit" name="submit">
<input type="reset" value="Reset" name="reset"> </font>
</td>
</tr>
</table>
</center>
<p align="center"><font color="#EFE87F"><b>Your wonid <u>MUST</u> be vaild
to play on server</b></font><font color="#FFFFCC"><br>
<BR>
</font>
</p>
</form>
</body>
</html>
<p> </td>
</tr>
</table>
<html>
<body bgcolor="#333333">
</body>
</html>