War of the Lands
New Member
- Messages
- 11
- Reaction score
- 0
- Points
- 0
Well... Im trying to get my registration/login form to work and as you can guess im not having much luck thats why im here! I use very simple php I know but I want it to work before using the more advance php. What is going wrong is on my active.php it is echoing the error varriable when it should not have been set. So please someone help me! Here is the source code:
PHP:
<?php
require_once "config.inc.php";
$error="";
$submit=$_POST['submit'];
if($submit) {
$user=$_POST['user'];
$code=$_POST['code'];
$check=mysql_query("SELECT count(*) FROM 'login' WHERE (username = '$user', active = '$code')");
}
if($check= 1) {
$result=mysql_query("UPDATE login SET active= '1' WHERE (username = '$user')");
$error="You account has now been activated, you may now login!<br>";
}
else {
$error="You have entered incorrect information. Try again!<br>";
}
?>
<html>
<head>
<title>War of the Lands</title>
<link type="text/css" href="style.css" rel="stylesheet">
</head>
<body>
<script type="text/javascript" src="http://x10hosting.com/adserve.js?corporate"></script>
<h1>Activation:</h1>
<?php echo $error; ?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<table>
<tr>
<td>Username :</td><td><input type="text" name="user"></td>
</tr>
<tr>
<td>Activation Code :</td><td><input type="text" name="code"></td>
</tr>
<tr>
<td></td><td><input type="submit" name="submit" value="Activate"></td>
</tr>
</table>
</form>
<br />
Copyright 2008 - War of the Lands
</body>
</html>