So, I'm using Kaels website, which gives me a account reg page. (which site doesnt? ^^)
Anyway, after setting it up, I can't get why I'm getting this error! I'm not a pro at theese kind of things, so I though I could ask those who are?
Here's almost whole code, I get a error on the red highlighted, (line25).
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<?php
if($_POST)
{
$con = mysql_connect("localhost", "root", "ascent");
if(!$con)
$msg = "Unable to create a Database connection.";
if($con)
{
mysql_select_db("LOGON-CHAR-DATABASE", $con);
$user = $_POST['login'];
$pass = $_POST['password'];
$email = $_POST['email'];
$pack = $_POST['formselect1'];
if(!$user)
$msg = "Please fill out your Username.";
else if(!$pass)
$msg = "Please fill out your Password.";
else if(!$email)
$msg = "Please fill out your E-Mail Address.";
else
{
$check = mysql_query("SELECT login FROM accounts WHERE login=\"".$user."\" LIMIT 1", $con);
if(mysql_numrows($check) > 0)
$msg = "This account already exists.";
else
{
$query = "INSERT INTO accounts (login, password, email, flags) VALUES ('" . mysql_real_escape_string($user) . "', '" . mysql_real_escape_string($pass) . "', '" . mysql_real_escape_string($email) . "', '" . mysql_real_escape_string($pack) . "');";
if(!mysql_query($query, $con))
$msg = "Creation of ".$user." has failed.";
else
$msg = "Account ".$user." has been created.";
}
}
@mysql_close($con);
}
}
?>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title>Account Creation</title>
<style type="text/css">
/*----------Text Styles----------*/
.ws6 {font-size: 8px;}
.ws7 {font-size: 9.3px;}
.ws8 {font-size: 11px;}
.ws9 {font-size: 12px;}
.ws10 {font-size: 13px;}
.ws11 {font-size: 15px;}
.ws12 {font-size: 16px;}
Anything I'm doing wrong? :/ Would really appreaciate some help here!
tell me if I'm doing something else rong aswell.
(You can check for yourself at cachewow.servegame.org
urs,
Antonp93 - pew.