Advertisement

05.15.2008 at 07:14PM PDT, ID: 23407276
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

Stay Logged In After PHP Registration?

Asked by dsellers99 in Macromedia Dreamweaver, PHP Scripting Language, PHP and Databases

I built a registration page in Dreamweaver using Developer's Toolbox. I'm trying to figure out how to keep users logged in after they register, instead of having to immediately log back in as they have to now. I asked this question a while back, but didn't get very far. I think the reason why is that code is tricky because it's designed in Developer's toolbox. But I found some more instructions recently:

-----------------------------
Next you have to add the automatic login functionality. A user is considered logged-in (from the MX Kollection 3 point of view) when two session variables are set (three if using access levels): kt_login_id and kt_login_user. The first stores the user ID and the second stores the user name. So, in order to login the user, you just have to set the correct values for these session variables after the registration process completes. To execute an action after the registration takes place, you must add a Custom Trigger of the AFTER type.

To implement the automatic login, follow the next steps:
Open the register page in Dreamweaver if necessary.
Add a Custom trigger from the Server Behaviors tab > + > MX Kollection > Forms > Custom trigger.
In the Basic tab of the user interface that opens you must add the code that sets the session variable values. Copy and paste the section of code that matches your particular server model below:
For PHP:
$_SESSION['kt_login_id'] = $tNG->getPrimaryKeyValue();
$_SESSION['kt_login_user'] = $tNG->getColumnValue('name_usr');

Next you have to edit the Insert transaction added by the User Registration Wizard, so that it will no longer redirect to the login page. Double click the Insert Transaction in the register page. Replace the value in the After inserting, go to text field with the index page - click the Browse button to select it from the site root or the page that you intend the user to go after successfully logging in
--------------------------------------------------------------------

So this gives me more to work with than I had before. Based on these instructions, I created the following session variable triggers:

<?php if (!session_id()) session_start(); if ($_SERVER["REQUEST_METHOD"] == "POST") { $_SESSION["kt_login_user"] = $tNG->getColumnValue('name_usr');
}?>
<?php if (!session_id()) session_start(); if (isset($_POST["KT_Insert1"])) { $_SESSION["kt_login_id"] = $tNG->getPrimaryKeyValue();
}
?>

I still can't get the registration form to stay logged in, but I think it may because I have the syntax wrong in the above code. Any ideas on what the code should look like to give it a better chance of working? Thanks for any help. - Dale

Start Free Trial
[+][-]05.15.2008 at 09:29PM PDT, ID: 21580005

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.15.2008 at 10:25PM PDT, ID: 21580209

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.15.2008 at 10:55PM PDT, ID: 21580310

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.16.2008 at 08:45AM PDT, ID: 21583780

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.07.2008 at 04:05AM PDT, ID: 21735007

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Macromedia Dreamweaver, PHP Scripting Language, PHP and Databases
Sign Up Now!
Solution Provided By: dsellers99
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628