RE: [PHP] Script Debug.

2002-03-07 Thread Hunter, Ray

Also you can set up php to show you all warnings and display them for you.
In the php.ini file you can change some values so that you can do some
debugging.

Here are the values you can change:

display_errors = On
display_startup_errors = On

or

error_log = syslog

or

error_log = filename


Having display_errors on will display errors to you when you run them.
Display_startup_errors will show startup errors that php has if any.  Or you
can have all errors go to syslog or have error_log = filename go to a
specific file for you.  This has helped me debug many scripts that did not
display errors for me.





Thank you,

Ray Hunter
Firmware Engineer

ENTERASYS NETWORKS


-Original Message-
From: DARCY,MATTHEW (Non-HP-UnitedKingdom,ex2)
[mailto:[EMAIL PROTECTED]] 
Sent: Thursday, March 07, 2002 7:52 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Script Debug.


Hi,

someone was helping me with this last night at home, but now I am in work I
am still struggling.

I have a user_auth script what works fine, it registers the username and
password as session variables then matches them to the rows entered in the
database - if they don't match it unregisters the session vars, if it does i
would like to ti register a new sesson var called user_auth_level (ie how
much authorisation this user has) this is the part of the script that does
that. When I print the $user_auth_level I get null ? can any one help. 

thanks, 

Matt.



else {
session_register("user_auth_level");
$auth_select = "select account_admin_level from account_details where
username='$login_username'"; $run_auth_select = mysql_query($auth_select);
$run_auth_select_results = mysql_fetch_row($run_auth_select);

$user_auth_level = $run_auth_select_results[0];

?>





 Access Granted 
Welcome you are fully logged into testsite.com
your access level is 





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Script Debug.

2002-03-07 Thread Matt Schroebel

Could be several things ...

> else {
> session_register("user_auth_level");
> $auth_select = "select account_admin_level from account_details where
> username='$login_username'";

Perhaps echo the sql statement here so you can see what you're trying to do.

> $run_auth_select = mysql_query($auth_select);

Check if the query was successful here. Success meaning the statement was valid; not 
that you got a result.  If it's not successful, then there's something wrong with the 
sql statement.

> $run_auth_select_results = mysql_fetch_row($run_auth_select);

Check here if you have a row before accessing the dataset below.  If you don't then 
take some error handling action such as redisplaying login with a message that the 
user wasn't found.

> 
> $user_auth_level = $run_auth_select_results[0];
> 
> ?>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Script Debug.

2002-03-07 Thread DARCY,MATTHEW (Non-HP-UnitedKingdom,ex2)

Hi,

someone was helping me with this last night at home, but now I am in work I
am still struggling.

I have a user_auth script what works fine, it registers the username and
password as session variables then matches them to the rows entered in the
database - if they don't match it unregisters the session vars, if it does i
would like to ti register a new sesson var called user_auth_level (ie how
much authorisation this user has) this is the part of the script that does
that. When I print the $user_auth_level I get null ? can any one help. 

thanks, 

Matt.



else {
session_register("user_auth_level");
$auth_select = "select account_admin_level from account_details where
username='$login_username'";
$run_auth_select = mysql_query($auth_select);
$run_auth_select_results = mysql_fetch_row($run_auth_select);

$user_auth_level = $run_auth_select_results[0];

?>





 Access Granted 
Welcome you are fully logged into testsite.com
your access level is 





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php