Not sure what's wrong?

Status
Not open for further replies.

Livar

Now 35% cooler!
Oct 15, 2010
846
86
Well, haidere. I'm coding a CMS, and well tbh, I'm doing 'da register. I've done the script, It's just it gives me an unexpected '{' in my code, here's the code.
PHP:
<?php
//#############################################################################
// QuoWEB - Lightweight CMS compatible with uberEmulator && Phoenix Emulator.
// Coded by powahcoder from DevBest dot COM
// Inspiration from Kryptos, and Tyler.
//#############################################################################
 
require_once 'global.php';
 
$page_name = "$site_name - Homepage";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title><?php echo $page_name; ?></title>
<link href="css/login.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<?php
$CheckIP = mysql_query("SELECT ip_reg FROM users WHERE ip_reg = '". $_SERVER['REMOTE_ADDR']."'");
$CheckAmount = mysql_num_rows($CheckIP); if($CheckAmount >= 3) {
echo "It appears you have registered more than once!"; } ?>
 
<?php
if (isset($_POST['email'])
{
$username = $_POST['username'];
$password = md5($_POST['password']);
$retypepassword = $_POST['retypepassword'];
$email = $_POST['email'];
 
if (strlen($username) < 1 || strlen($username) > 12) {
 
echo "Sorry, your username must be 1 - 12 characters long"; }
 
if (strlen($email) < 12) {
 
echo "Please enter a valid email address"; }
 
if (strlen($password) < 6) {
 
echo "Sorry, your password must be at least 6 characters long"; }
       
if ($password != $retypepassword) {
 
echo "Sorry, your passwords do not match."; }
 
mysql_query("INSERT INTO users (username,password,mail,rank,look,gender,motto,about,credits,activity_points,account_created,ip_last,ip_reg) VALUES ('".$username."','".$password."','".$email."','1','hd-180-1.ch-210-66.lg-270-82.sh-290-91.hr-100','M','New User','New User','500','100','".date('M d, Y')."', '".$_SERVER['REMOTE_ADDR']."', '".$_SERVER['REMOTE_ADDR']."')");
}
else { ?>
<tr><td><b>Username</b><br/><input type="text" name="username"/></td></tr>
<tr><td><b>Email</b><br/><input type="text" name="email" /></td></tr>
<tr><td><b>Password</b><br/><input type="password" name="password"/></td></tr>
<tr><td><b>Confirm Password</b><br/><input type="password" name="retypepassword" id="retypepassword"/></td></tr>
 
<?php } ?>
 
</body>
</html>
some help would be gr8.
 

Markshall

Русский Стандарт
Contributor
Dec 18, 2010
2,637
2,389
Yeah that code is very ugly - no wonder it's hard to tell where you've gone wrong.

Space out the code and indent it properly -- it may be indented but for some reason, DevBest removes the indentations :s.

Anyway, you have 'if' statement on the same lines of other codes. You need to spread them out.

Indenting your code makes find what { links to what } a lot easier.
 
Status
Not open for further replies.

Users who are viewing this thread

Top