Forums

PHP

This topic is locked

Registration by email

Posted 04 Sep 2002 21:02:19
1
has voted
04 Sep 2002 21:02:19 Jason Baxter posted:
Hi,

We're using DWMX and Phakt w/MySQL. I'm setting up a registration page where a user chooses a username and company name and a password is mailed to the person registering with us. I have set up several pages to guide registrants through this process:

signup.php "Initial Welcome" -Where they enter their name, email and choose a username.

signupA.php "Business Type" -If the username is taken, a show-if-recordset-is-not-empty field gives them the same form on the first page. If the username is available, a show-if-recordset-is-empty field gives them choices of their type of organization. Each choice is an individual insert-record form with the variables from the first page carried over into hidden fields by $HTTP_POST_VARS["whatever"] and a randomly generated password. This section of the page is the workhorse, as it enters all the info into the "LogInfo" table of the database, which it does successfully.

signupA1.php "Continue" -The only real purpose of this page is to take the username variable from the previous and put it in a form as a hidden variable. The registrant only sees the button of the form that says "continue >>" but it really dresses the variable for the next page to create a recordset. This is were I tend to lose it.

signupA1a.php "Verify" -This page, to the viewer, is just a verify info page with a "next >>" button, but it's purpose is to filter the username from the previous page into a recordset, put the info into hidden fields in a form, and insert them into the appropriate columns of the MainInfo table of the database when they hit "next >>". This works, except the hidden fields are either always empty (so it inserts no record) or they have the LogInfo of the first record of the LogInfo table.

signupA2.php "Agreement" -To the viewer, this is the "I agree to the terms..." page, but really it's the mail form. The "I Agree" button is to a form with hidden fields containing the mailto address, subject, and body (containing the registrants password and username). This page works, except the info from the recordset is empty.

Although this seems very complicated, my problem is one of carrying over variables from one page to the next using different methods. Any help would be greatly--and I mean greatly--appreciated.

Jason

Replies

Replied 06 Sep 2002 09:55:39
06 Sep 2002 09:55:39 Aurel Sorin Cirstoiu replied:
Hello,

You will have to write some hand code. User id and all the other variables you need in the end will be store in session variables.
So after the first form(let's say in the first form you have a field called id_usr) place this code at the beginning of the file file containing second form.

<?php
session_start();
$id_usr = $HTTP_POST_VARS["id_usr"];
session_register("id_usr";
//Do the same thing with other variables
?>


In the end to use the session variables you can access them like this:
$HTTP_SESSION_VARS["id_usr"]
(don't forget to use session_start() before).

Please tell me if this helped you.


-----------------------
Cirstoiu Aurel Sorin
InterAKT Support
www.interakt.ro
-----------------------
Replied 06 Sep 2002 22:52:16
06 Sep 2002 22:52:16 Jason Baxter replied:
Thanks. That solved my problem and many future ones. You rock. When is the commercial version of Phakt comming out?

Reply to this topic