Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Dreamweaver login server behaviour?

Guest
Mar 16, 2007 Mar 16, 2007
This is my page that uses dreamweaver's login behaviour:
Now I want to change, add or edit without losing the login behaviour option in the Applications panel?
Any ideas of how to?


Cheers
West
TOPICS
Server side applications
528
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 16, 2007 Mar 16, 2007
Westmatrix99 wrote:
> This is my page that uses dreamweaver's login behaviour:
> Now I want to change, add or edit without losing the login behaviour option in
> the Applications panel?
> Any ideas of how to?

It depends what you want to edit. If you make any changes to the code
created by the server behavior, you can no longer open the server
behavior dialog box through the Applications panel. If you make your
changes outside the server behavior code, it remains accessible.

--
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 16, 2007 Mar 16, 2007
Ok this is my ASP page same idea:

MM_rsUser.Source = "SELECT txtUsername, txtPassword, intUserID" ' this I added as needed it

Session("MM_UserID") = MM_rsUser("intUserID") ' same here added as needed it

But in PHP can't do or where do I do this?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 16, 2007 Mar 16, 2007
Westmatrix99 wrote:
> Ok this is my ASP page same idea:

Instead of showing me ASP, tell me what it is that you want to do, and
I'll see if I can suggest how to do it in PHP.

--
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 16, 2007 Mar 16, 2007
I want to get any data that I need from the database in order to assign it to a session variable?
This must happen at the login page.

(As I am able to do in ASP)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 16, 2007 Mar 16, 2007
Westmatrix99 wrote:
> I want to get any data that I need from the database in order to assign it to a session variable?
> This must happen at the login page.

I've just noticed that the PHP login code you have posted appears to be
the buggy version from MX 2004.

To start off with, you need to do a Find and Replace operation. Find
$GLOBALS and replace with $_SESSION. Also comment out all lines that
begin with session_register.

<?php require_once('../Connections/cnmail.php'); ?>
<?php
// *** Validate request to login to this site.
session_start();
$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($accesscheck)) {

//*************** Make changes here*************
$GLOBALS['PrevUrl'] = $accesscheck; <----- should be
$_SESSION['PrevUrl']
// session_register('PrevUrl'); <----- needs to be commented out
}
// *********************************************

if (isset($_POST['userid'])) {
$loginUsername=$_POST['userid'];
$password=$_POST['password'];
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "index.php";
$MM_redirectLoginFailed = "dreamweaver.php";
$MM_redirecttoReferrer = true;
mysql_select_db($database_cnmail, $cnmail);

//******************************************************************
// Change the SQL here. Delete username, password and replace with *
$LoginRS__query=sprintf("SELECT * FROM users WHERE
username='%s' AND password='%s'",
get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername),
get_magic_quotes_gpc() ? $password : addslashes($password));

//******************************************************************

$LoginRS = mysql_query($LoginRS__query, $cnmail) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);

//*********** Get the results from the database query
$row = mysql_fetch_assoc($LoginRS);
//****************************************************

if ($loginFoundUser) {
$loginStrGroup = "";

// ********************************
//declare two session variables and assign them
$GLOBALS['MM_Username'] = $loginUsername; <----- Should be
$_SESSION['MM_Username']
$GLOBALS['MM_UserGroup'] = $loginStrGroup; <---- Should be
$_SESSION ['MM_UserGroup']

// Create any session variable here
$_SESSION['fieldName'] = $row['fieldName'];


//register the session variables
//session_register("MM_Username");
//session_register("MM_UserGroup");
// ************************************************
if (isset($_SESSION['PrevUrl']) && true) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
header("Location: " . $MM_redirectLoginSuccess );
}
else {
header("Location: ". $MM_redirectLoginFailed );
}
}
?>

--
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 16, 2007 Mar 16, 2007
LATEST
Thanks will give it a try and see what happens, but am tired of coding today.
Will rest a bit then try later.

Thanks
Cheers
West
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines