Re: New User Script Failing Unexpectedly.

From: Date: Mon, 01 Sep 2003 19:04:20 +0000
Subject: Re: New User Script Failing Unexpectedly.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-161380@lists.php.net to get a copy of this message
312 lines is a lot of stuff to filter through, you should really isolate your problem. * Thus wrote Adam Bishop (TMX@ntlworld.com): > Sample 'A' > > <?PHP This is an xml tag, it should read <?php (all lowercase) > switch (@$do) > { > case "process": You should indent, it makes the code more readable. > session_start(); > session_register('Sauth'); > session_register('Slogname'); > session_register('Spermissionlevel'); > session_register('Sapprove'); Consider using $_SESSION instead of the old method of session_register. > include("thing.inc"); > > foreach($HTTP_POST_VARS as $key2 => $value2) > { > $$key2 = $value2; You already have register_globals on, thus this is pointless. And also strongly discouraged. > } > > > [..snip..] > > $connection = mysql_connect($host,$user,$password) or die("Couldn't Connect to > server"); > $sql = "SELECT username FROM members WHERE username='$username'"; > $result = mysql_query($sql) or die("Failed to check user name"); > $num = mysql_numrows($result); This should be mysql_num_rows($result); > > if ($num != 0) Curt -- "I used to think I was indecisive, but now I'm not so sure."

« previous php.general (#161380) next »