Dreamwaver 'login' Behaviors

software development

#1

Just completed a login page which uses the Dreamwaver MX Behaviours. Works great on my local machine, but when I’ve published the pages on DH it doesn’t work!!!

Doing some testing - the logon page successfully validates the user - then redirects the user to a new page. This page checks the “MM_Username” session which should hold the Users ‘ID’ but is not set.

Any one have any ideas???

PS Just moved over to DH

login Code DW creates

<?php // *** Validate request to login to this site. session_start(); $loginFormAction = $_SERVER['PHP_SELF']; if (isset($accesscheck)) { $GLOBALS['PrevUrl'] = $accesscheck; session_register('PrevUrl'); } if (isset($_POST['userid'])) { $loginUsername=$_POST['userid']; $password=$_POST['pwd']; $MM_fldUserAuthorization = ""; $MM_redirectLoginSuccess = "Untitled-1i.php"; $MM_redirectLoginFailed = "Untitled-1.php"; $MM_redirecttoReferrer = false; mysql_select_db($database_BassjuniorsDB, $BassjuniorsDB); $LoginRS__query=sprintf("SELECT usr_email, usr_password FROM tbl_users WHERE usr_email='%s' AND usr_password='%s'", get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password)); $LoginRS = mysql_query($LoginRS__query, $BassjuniorsDB) or die(mysql_error()); $loginFoundUser = mysql_num_rows($LoginRS); if ($loginFoundUser) { $loginStrGroup = ""; //declare two session variables and assign them $GLOBALS['MM_Username'] = $loginUsername; $GLOBALS['MM_UserGroup'] = $loginStrGroup; //register the session variables session_register("MM_Username"); session_register("MM_UserGroup"); if (isset($_SESSION['PrevUrl']) && false) { $MM_redirectLoginSuccess = $_SESSION['PrevUrl']; } header("Location: " . $MM_redirectLoginSuccess ); } else { header("Location: ". $MM_redirectLoginFailed ); } } ?>

#2

Have you compared PHP setups for your local & DH?

Maybe to do with DH running PHP as cgi??


#3

Thks Apidev

Just dumped out “phpinfo” on both severs, Yes found it - I have register_ global “on” and DH is “off”. Switching mine to “off” I get the same results as I do on DH. O’well at lest I know – shouldn’t rely on DW creating php for ya!!!

Thanks mine night sorted !!!


#4

Actually. You’re incorrect. I’ll say this once: TURN OFF REGISTER_GLOBALS

Sorry, but NOBODY should be using register_globals now. If the script you’re using requires then, then that scripts is just … well, it’s a bit rude so I won’t say.

Sorry if I sound a bit crude. But I’m sick and tired of everybody thinking “register_globals off” is a bad thing. People do not realize register_globals is the Achilles heal of PHP. PHP developers regret ever creating it. They’ve told everybody to STOP using it since 1999, turned it off by default in 4.2.0 and wished they’d removed it in PHP5.

Now PHP6 will be out soon and there will be NO register_globals option. It will be GONE. As a certified PHP developer, I’m ecstatic. Once it’s GONE people will no longer say “omg, turn on register_gloabls.” Maybe then they’ll finally understand that register_globals == BAD THING.


yerba# rm -rf /etc
yerba#