Forum Moderators: coopster

Message Too Old, No Replies

PHP/MYSQL Login Autofill

How to redirect to a users registration page and autofill.

         

tomrockymtn

10:54 pm on Mar 4, 2008 (gmt 0)

10+ Year Member



Greetings.

Using the PHP Dynamic Page of DWCS3 features I've created my forms and MYSQL database and all works well. My application for this project requires that users are able to go back and add to or modify their form. Since they contain credit card info etc., they must be directed to only their information/update form after they have successfully logged in and entered their code (which is the unique key generated in MYSQL).

I wanted to accomplish this by using a unique login and password which would trigger the autofill into the form from the database.

The username and password are in the table record with their data (we're manually entering this since we are only talking 85 registrants). The DW PHP Login works fine but I can't get the record id (which is what I'm using to repopulate the form) to trigger the "%s" after the login. I've tried the hidden form field but that didn't work (or I'm not coding correctly).

If I force the record number to be 1 in the update form instead of "%s" it works fine, so I just can't get the record ID to pass to the form after the person logs in.

Does anyone have a solution to this? Better way to go about it?

I really appreciate your time and thoughts.

elitebomber

1:20 am on Mar 5, 2008 (gmt 0)

10+ Year Member



One way of doing it:

At the login page, if the login is successful, register a session variable like $_SESSION["record_id"] = $record_id.

Then in the form page do a check if($_SESSION["record_id"]){ query database based on $_SESSION["record_id"] and select all the info from the database and store it in variables and use that to populate the forms} else { direct user to login page }.

That's one way of doing it. There are several others.

tomrockymtn

7:45 pm on Mar 5, 2008 (gmt 0)

10+ Year Member



Thank you! I'll give that a try.