Staredit Network

Staredit Network -> Computers and Technical -> Alleged Syntax Error
Report, edit, etc...Posted by Syphon on 2006-07-23 at 22:20:27
Alright, I'm writing my script, and before I even finished it somebad happens.

CODE

<?php
//Database Information
$dbhost = 'db5.awardspace.com';
$dbname = '*youcan'tseethese';
$dbuser = '*youcan'tseethese';
$dbpass = '*youcan'tseethese';
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
mysql_select_db($dbname) or die(mysql_error());
//Registration Information
$name = $_POST['name'];  
$pass = $_POST['pass1'];
$passcon = $_POST['pass2']
//Check for existing names
$checkname = mysql_query("SELECT name FROM users WHERE name='$name'");
$name_exist = mysql_num_rows($checkname);
if($name_exist > 0)
{
echo "The user ID you chose has already been taken. Pick another.";
   unset($name);
   include 'register.php';
   exit();
}
//Check for password like-ness
if ($pass !== $passcon)
{
echo "The passwords you have entered do not match. Confirm them again.";
unset($pass);
unset($passcon);
include 'register.php';
exit();
}
?>


The error I get when I run it is;

QUOTE
Parse error: syntax error, unexpected T_VARIABLE in /home/www/syphon.awardspace.com/registercon.php on line 28


To save you the trouble of looking throguh the whole thing, line 28 is;

CODE

$checkname = mysql_query("SELECT name FROM users WHERE name='$name'");


WhaduIdu?
Report, edit, etc...Posted by MindArchon on 2006-07-24 at 16:12:50
CODE
$passcon = $_POST['pass2']


You didn't terminate your vairable with a ;

Thats the line before the one the error gave out tongue.gif
Report, edit, etc...Posted by Syphon on 2006-07-24 at 18:26:57
*Syphon is blind.
Thanks.
Next Page (1)