registration page help

Joined
Jul 28, 2008
Messages
2
Reaction score
0
i got appserv and mysql already install and i setup my registration page already but now when some1 registers its says sucessful but when i check my database they're not registered.
how can i connect my registration so it actually registers into my database. this is the php script i use:
<html>
<head>
<title>SparkCo Registration Form and Status</title>
</head>
<center><b><u>Welcome To SparkCo</u></b><br />
Don't worry about passwords, Passwords will be automatically set on first login.</center><br />
<body>
<form method="post" action="index.php">

<center>Username: <input type="text" name="username" size="30" />
<input type="submit" value="Complete Registration" name="Submit"/></center>
</form>
</body>
<center><br />Step 1: Download Powersourceco here: http://www193.megaupload.com/files/c4d6cefa11c2eae2ec166ad72a6d57a7/PowerSourceCO.rar<br>Step 2: Open your server dat and change the ip to 5.32.41.226<br>Step 3: Then save your server dat then run play.exe then bypass.</a>
<br /><br />Copyright 2008 Krysis.</center><br /><br />

<center><b></b>Server Status:</b> <img src="http://status.blackout-gaming.net/status.php?dns=5.32.41.226&port=9958&style=8" alt="Status Checker Running" border="0"></center>
</html>

<?php
$link=mysql_connect ("localhost", "root", "123") or die ('Error: ' . mysql_error());
mysql_select_db ("coproj");
$res = mysql_query("SELECT count(*) FROM accounts;");
$val = mysql_fetch_array($res);
echo "<br /><center>Total Accounts Created: ".$val[0]."</center>";

$res = mysql_query("SELECT count(*) FROM characters;");
$val = mysql_fetch_array($res);
echo "<center>Total Characters Created: ".$val[0]."</center>";

$username = $_POST['username'];

if(isset($_POST['Submit'])) {
if(!$_POST['username']) {
die('<center>You must fill in all of the fields!</center>');
}
$check = mysql_query("SELECT * FROM accounts WHERE AccountID = '$username'");
$check2 = mysql_num_rows($check);
if($check2 != '0') {
die("<center>Username: '".$username."' is in use!</center>");
}

mysql_query("INSERT INTO accounts (AccountID,LogonType) VALUES ('$username','2')");
die("<center>Username '".$username."' successfully registered!</center>"); }
and also the picture keep showing offline even though my server is online and 4 ppl are in it.
 
Last edited:
Back