Skip to main content
Participant
October 17, 2008
Question

PHP registration page help!!

  • October 17, 2008
  • 7 replies
  • 285 views
Hi, I am in the process of redesigning my union's website to include a member area. Here's my problem...
I already have a database for our union members. What I want to do is to be able to have register using data that I already have for them in a table: Last Name, First Name, Date of Birth, Last 4 digits of SSN. There will also be fields for user name and password (which will originally be blank in the table). When the user hits the submit button, the form data needs to compare those first 4 submitted fields to the corresponding ones in the existing table (much the same way a credit card company might do with an existing account). If the data submitted matches what's in the table, the user name and password submitted in the form are written to the table and the user should be redirected to a login page.
How should i go about building such a registration page??
Help!!! ???

Thanks,
rborc415

This topic has been closed for replies.

7 replies

Inspiring
October 28, 2008
rborc415 wrote:
> However, when I link to the update page i built, the page
> displays the very first record in the database! Do I use the same recordset
> for both pages or should I create a different one for the update page?

When you retrieve both Joe Soaps, they should each have their own
primary key. Use the primary key in the link leading to the update page:

<a href="update.php?id=<?php echo $row_recordsetName['id']; ?>">Update
record</a>

This should produce links such as

update.php?id=27
update.php?id=44

Use $_GET['id'] in the update page to retrieve the details of the
correct Joe Soap.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
rborc415Author
Participant
October 28, 2008
Again, may thanks for the fast replies!
I tried what you suggested, and I got to the point where I have a dual "Joe Soap" scenario. However, when I link to the update page i built, the page displays the very first record in the database! Do I use the same recordset for both pages or should I create a different one for the update page?

Many Thanks,

rborch@iatselocal4.org
Inspiring
October 27, 2008
rborc415 wrote:
> The problem is this: I have several members who have
> the same flirt and last names (different ages, SSN's of course). But when I
> enter the user data for the "father" (let's say), I get the data for the "son",
> because the latter is the first record the query encounters.

If you're using only the first and last names in your search, you need
to create an interim results page that shows the details of all matching
records.

Search for Joe Soap

Put the results in a repeat region, and display the DOB and SSN. Put the
primary key in a link to the update page.

Joe Soap 5/5/1948 4567 Update link contains primary key 1
Joe Soap 12/4/1974 3648 Update link contains primary key 37

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
rborc415Author
Participant
October 27, 2008
Thanks!

I tried what you suggested, and was able to build a recordset, as well as a search and result page. The problem is this: I have several members who have the same flirt and last names (different ages, SSN's of course). But when I enter the user data for the "father" (let's say), I get the data for the "son", because the latter is the first record the query encounters.
How do I get the Primary Key ('record') involved in this?
I've tried incorporating it into the form link parameters on the search page but with no luck.

thanks

Inspiring
October 24, 2008
rborc415 wrote:
> I've been knocking around with what you suggested and I'm kind of flying blind
> at this point... could I ask you to be a little more specific?

Basically, what you are doing is creating a search page. If the search
produces a result, you want to display an update form. You can either do
it all in one page, and control what it displayed with conditional
logic, or you can use session variables pass the information from one
page to the next.

The basic way to do it with separate pages is to create a search form in
page 1. Get the user to enter the four items. Send the form using the
GET method to page 2.

In page 2, create a recordset to search for the record, using the $_GET
variables. If the recordset is empty, display a message saying "record
not found". If the recordset is not empty, display the results in an
update form, using readonly fields for the already-registered values.
Use ordinary text fields for the items you want the user to fill in.
Apply an Update Record server behavior.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
rborc415Author
Participant
October 24, 2008
I've been knocking around with what you suggested and I'm kind of flying blind at this point... could I ask you to be a little more specific? I can get to the point where I create a recordset of all the records to print to a page with the record number as a link. when I click the record number, the details of the record appear on a separate page.
This is very similar to what's in your book "The Essential Guide to Dreamweaver CS3") in Chapter 14.
I want the same end result, but I want to be able to have the member input the 4 fields I specified earlier to get to that point.
I've batted around some sample recordsets, but without success.
rborc415
Inspiring
October 17, 2008
rborc415 wrote:
> How should i go about building such a registration page??

You should also add a primary key to the table to identify each record.

Create a recordset to select all records that match the last name, first
name, DoB, and last 4 digits of the SSN. Check the number of rows
returned, if it's one, use the primary key to insert the username and
password.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/