PHP syntax error when testing registration system
Posted: Mon Sep 22, 2008 12:54 am
This is the error message:
Parse error: syntax error, unexpected '`' in C:\wamp\www\register\Untitled-7.php on line 13
What can i do to make this work?
This is my code:
Parse error: syntax error, unexpected '`' in C:\wamp\www\register\Untitled-7.php on line 13
What can i do to make this work?
This is my code:
Code: Select all
<?php
$congig['adress']='localhost';
$congig['username']='craig';
$config['password']='porschegt3';
$config['databsename']='regtut';
mysql_connect($config['address'],$config['username'],$congifg['password']);
mysql_select_db($config['databsename']);
if ($_POST['submit']) {
$_POST['username'] = trim($_POST['username']);
if($_POST['username'] && strlen($_POST['username']) >= 3){
$query = mysql_query(”SELECT `id` FROM `users` WHERE `username`=”.$_POST['username'].”‘ LIMIT 1?);
if(mysql_num_rows($query)){
$error['userexists'] = ‘Username exists’;
}
} else {
$error['usernameinput'] = ‘Please enter a username of 3+ characters’;
}
}
?>
<form name=”reg” method=”post” enctype=”application/x-www-form-urlencoded”>
username: <input type=”text” name=”username” /><br />
email: <input type=”text” name=”email” /><br />
password1: <input type=”password” name=”password1? /><br/>
password2: <input type=”password” name=”password2? /><br/>
<input type=”submit” name=”submit” value=”register” />
</form>