Skip to main content
Participating Frequently
September 27, 2006
Question

Implementation of a sign-up (not sign-in) form in MySQL

  • September 27, 2006
  • 6 replies
  • 868 views
Hi,

I am a newbie to PHP/MySQL. However, I have successfully created several databases and connected to them. I've been able to create users and sign-in pages (admin sections) to add, edit and delete items to the database.

However, I've hit a wall with a project I'm working on.

The goal is to create a system where people can sign their kids up for a class. So, I have created several tables for that purpose. A "family" table for the parents, a "student" table for the kids, a "class" table for the each class and then a user type" table to determine the level of access that each user will have.

Each family has a unique family_id and each student has a unique student_id. Each student_id record has a family_id collumn as a foreign key, since each family can have one or more kids.

How do I create a system where parents can log in and ONLY see whether their own kids are signed up or not for a particular class and add them to it if they are not?

I would appreciate any help.
This topic has been closed for replies.

6 replies

ElfkonigAuthor
Participating Frequently
October 8, 2006
I did what you suggested, placing the third variable within its own tags. The good news is that by doing that the error message and the additional login disappeared. The bad news is that it didn't do anything beyond that.

In the listing page (I only have the login page and the listing page so far), the Username comes up by inserting:

<?php
session_start();
echo $_SESSION['MM_Username'];
?>

so I know that the right user is logged in. However, when I also add

<?php
session_start();
echo $_SESSION['MM_Family'];
?>

the family ID doesn't show up.

Besides, assuming I am managed to put the Family ID in the SESSION, how do I retrieve it?

Also, Crash, do you know of any way that one could chat with an expert in real time? I feel like I'm inches away from solving this problem, and if I could run a couple of trial-and-error approaches with someone guiding me, it'd be taken care of in a matter of minutes no doubt.

Please let me know your thoughts.

Thanks.

ElfkonigAuthor
Participating Frequently
October 8, 2006
Ok. Below is the code for the recordset from which I am building the listing for the students.

What do I need to add to that recordset to filter it against the MM_Family session variable that represents the Family_ID? I have successfully added a {Session.MM_Family} dynamic text which proves that the session is using the correct Family ID. I entered

session_start();
$_SESSION['MM_Family'] = $row_rsFamily['id_Family_fam'];

before the recordset code. Now, however, I don't know how to add that variable to the recordset that use to create the listing.

Any ideas?
Inspiring
October 2, 2006
You can set the Session ID in your login page, as you know they will be
hitting that (whereas if you set it on another page you really might not
know which page they will be accessing).

You should then be able to filter all recordsets by the
$_SEssion['FamilyID'] var.

I saw you posted above, assumign same problem will reply there as well.

jon

"Elfkonig" <webforumsuser@macromedia.com> wrote in message
news:efkgva$caf$1@forums.macromedia.com...
>I have figured out how to filter, but where do I set the
>$_SESSION['FamilyID']? In the login page, or in the listing (results by
>Family) page)?
>
> Let me know if seeing the code would help. Thanks.


ElfkonigAuthor
Participating Frequently
October 2, 2006
It would make sense to use it there, but how do I turn the $_SESSION['variable'] from 'MM_Username' to 'Family_ID' when the form asks for the Username and the Password to let people log-in? It's that part that I don't know how to implement.



quote:

Originally posted by: Newsgroup User
You can set the Session ID in your login page, as you know they will be
hitting that (whereas if you set it on another page you really might not
know which page they will be accessing).

You should then be able to filter all recordsets by the
$_SEssion['FamilyID'] var.

I saw you posted above, assumign same problem will reply there as well.

jon

"Elfkonig" <webforumsuser@macromedia.com> wrote in message
news:efkgva$caf$1@forums.macromedia.com...
>I have figured out how to filter, but where do I set the
>$_SESSION['FamilyID']? In the login page, or in the listing (results by
>Family) page)?
>
> Let me know if seeing the code would help. Thanks.





ElfkonigAuthor
Participating Frequently
September 30, 2006
I have figured out how to filter, but where do I set the $_SESSION['FamilyID']? In the login page, or in the listing (results by Family) page)?

Let me know if seeing the code would help. Thanks.
ElfkonigAuthor
Participating Frequently
September 29, 2006
I am afraid I have a long way to go still to get a handle on code.

I inserted the echo $_SESSION['MM_Username'] code that you suggested and indeed, my record listing page shows the name of the username that logged in.

After that, I simply don't know how to filter recordsets. I've been looking around but have found no clear instructions. I've used a number of self-teaching guides, such as PHP for DW 8 and others, but there's no mention of filtering.

Any hints?
ElfkonigAuthor
Participating Frequently
September 28, 2006
I am trying to implement your suggestion, which makes total sense. I'll let you know the results.
Inspiring
September 27, 2006
Once the parent is logged in, you should have a value for their family_id.

Search the student tables for the corresponding family_id an list the
members of that family currently enrolled in classes.


"Elfkonig" <webforumsuser@macromedia.com> wrote in message
news:efei4e$ofn$1@forums.macromedia.com...
> Hi,
>
> I am a newbie to PHP/MySQL. However, I have successfully created several
> databases and connected to them. I've been able to create users and
> sign-in
> pages (admin sections) to add, edit and delete items to the database.
>
> However, I've hit a wall with a project I'm working on.
>
> The goal is to create a system where people can sign their kids up for a
> class. So, I have created several tables for that purpose. A "family"
> table for
> the parents, a "student" table for the kids, a "class" table for the each
> class
> and then a user type" table to determine the level of access that each
> user
> will have.
>
> Each family has a unique family_id and each student has a unique
> student_id.
> Each student_id record has a family_id collumn as a foreign key, since
> each
> family can have one or more kids.
>
> How do I create a system where parents can log in and ONLY see whether
> their
> own kids are signed up or not for a particular class and add them to it if
> they
> are not?
>
> I would appreciate any help.
>


ElfkonigAuthor
Participating Frequently
September 27, 2006
Thanks Crash.

However, therein lies my problem. I don't know how to get the value of the logged-in family.

quote:

Originally posted by: Newsgroup User
Once the parent is logged in, you should have a value for their family_id.

Search the student tables for the corresponding family_id an list the
members of that family currently enrolled in classes.