How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask TheDoctor Your Own Question
TheDoctor, Professional w/Adv. Degree
Category: Homework
Satisfied Customers: 1757
Experience:  M.S. in Internet Information Systems
Type Your Homework Question Here...
TheDoctor is online now
A new question is answered every 9 seconds

Account Registration Proces:Create an account registration

This answer was rated:

Account Registration Proces:

Create an account registration page that allows a new user to create an account. The user enters an account name, a password, and an alternate
e-mail account. If the account name is XXXXX XXXXX to any other user and the password XXXXX is not empty, configure PHP by using Macromedia Dreamweaver MX 2004 to send an automated e-mail message to the user on the specified alternate e-mail account. The user has to reply to the automated e-mail message.

Update the database with the new account information, and set the status of the account to pending.

If the user replies to the mail, send a specific URL in the following format:
Activate the account, and set the status to active in the database.
Note: Allow only active users to log on to the site.
Order Placement and Processing

Trigger an automated e-mail message [email protected] as soon as a customer places an order online. The e-mail message should contain a link to the order view page.

Trigger an automated e-mail message to the customer informing whether the order is being processed or is rejected when an IBG, Inc. agent approves or rejects the order from a customer.
Hello again. Thank you for requesting me. Please remember to start your questions with **For TheDoctor** when you request me.

Please place all of the requirements into a word document and upload that word document to

Once uploaded, you will be given a link on the right. Click on the 'Copy Link' option and then paste it here.

Thank you
Customer: replied 4 years ago.




word doc and php files and site we have been working on in a zip file.

Thank you,

I will contact you once this is complete.
Customer: replied 4 years ago.

Ok. No rush. It is Easter. I tried to do it myself, but I am just not grasping the different tasks I have to complete. Too many in this assignment.


Thanks Doc...






No problem. I will contact you once this is complete. It may be a day or so. Thank you.
Hello again,

I do not have the inventory table for your database.

Can you please export your database with phpmyadmin and send me the file.

Thank you
Customer: replied 4 years ago.

Here is the entire DB and just the inventory.


I only added a few products into the inventory table. That is the one I did by myself... How did I do??? LOL.

I'm trying to figure out why your class had you create an account creation page last week and now wants a registration page this week.

It doesn't seem like the course is flowing in a linear direction. Why weren't the instructions on the registration process part of creating the account creation page? It's just an odd series of assignments.
Customer: replied 4 years ago.
Agreed. We can just add to the account creation page if u want. Just adding the email part and verification to that page.
Yes, that is what I am doing.
Hello again,

You can download the completed assignment here:

Alright, this will take a lot of instructions, so please try to follow them as closely as possible.

First, you cannot test email from your local computer without using a special tool. Emails require an SMTP server in order to work. Even with WAMP or XAMPP installed, you do not have an SMTP server. So you will want to go here and download that tool. Once it is downloaded, install it. Once it is installed, run it. Do not change any of the options. Just run it and leave it open. This tool will intercept any emails that your PHP attempts to send and will open the email in your default email client (Outlook or whatever else you have set up as your default email application).

Implementing all of this required a significant amount of work and changes. Doing the emails for the sign up was one thing. However, the emails for orders and order processing were a lot more difficult because there were no options for order or order processing. So all of that functionality had to be implemented before I could even worry about the emails.

When I started doing this, I noticed that your database for these things was setup incorrectly. First, you had a product list table and an inventory table. Both of these tables had a product name, a UPC Code, etc. That is a violation of basic normal form and will cause major issues when attempting to implement a front-end to the database (what we are doing). Most of those fields are only required in the product list table. The inventory table references the product list table, so those fields are completely redundant within the inventory table.

In addition to that, you had the inventory table referring to the product table and the product table referring to the inventory table on the same key. This is a recursive relation and a major database error. This will throw database errors ever time you attempt to insert an item into the database.

So, I had to make major changes to the database, including changing those table, adding order-related tables, and modifying the login table for the registration process. So the database you have is no good any more. The new database is very different.

You will want to drop your database and then recreate it and run the SQL I have included in this zip file. It is in the file called newdb.sql

Once you have correctly installed the email test tool, have it running, and have recreated your database with the new database file, you will be ready to test.

Start out by creating a new customer account. After you submit your account creation form, the page states "Account Created". At this time, the email test tool will trigger your default email application to open. For now, just keep it open. It will display the email from the web site.

Now, go to the login page on your site and try to log in as the new user. You will notice that you receive the message that your login is incorrect. That is because the registration has yet to be confirmed.

No go to the email that was opened and follow the link in the email. This will take you to your index page and you will receive a small message that the verification was successful.

Now attempt to log in and it will work.

Now you are logged in as a customer. Click on the "Place Order". Right now, the database has one product. Enter your quantity and place the order.

A new email is triggered in your default email client. It thanks you for your order and gives you a link to view your order. Click on the link and you will see a simple table with order details.

Now, log out from the site.

Log back in with the username admin password admin

Click on the navigation link called Admin Orders

You will the ability to Approve or Reject any pending orders. Click on one of them. This will trigger yet another email in your default email client that informs you that your order has either been approved and processed, or rejected.

So that covers all of the requirements for this particular assignment:

Registration Page - Done
Email on Registration - Done
Confirmation URL in Email - Done
Order Email - Done
Order Processed Email - Done

That is all of the requirements for this assignment.

I did change your inventory page because I had to change the inventory table so drastically in order to make it actually function as part of an order system and be in proper relational database format.

What you did was fine, but I do have one note. You should be avoiding mysql API functions (e.g., mysql_connect, mysql_select_db, mysql_query, etc.)

These functions are deprecated and the next release of PHP will have them removed completely from the PHP language. You shoudl avoid using functions that are deprecated because in the real world, they will eventually cause you major headaches. Better to learn and use the recommended and supported functions. This would be the mysqli object. You can see throughout the site how I utlize mysqli. And, of course, you can read all about it on

It is actually much easier to use once you get used to it.

Let me know if you have any questions. I'm here to help.

Please remember to rate my answer. Thank you so much!
Customer: replied 4 years ago.


I am going to drop the database. But I thought we had it in a database called igb?



DROP SCHEMA customers;


USE customers;



what is the proper commands to do what you need me to do for the newdb.sql file?

The database you sent me when I first asked you for a database was called customers. The code that you first sent me when you began working with me on this project referred to a database called customers. Even your inventory page referred to customers. So I followed your lead and called the database customers.

You have the proper commands there. After running those three, you would import the file that I sent you. You can either paste in everything from that file or use the import tool in phpmyadmin.

Whenever you are ready, please remember to rate my answer. You may always come back here and ask follow up questions or ask for assistance with this part of the project.

Thank you so much for using JustAnswer. Have a great day!
Customer: replied 4 years ago.

As I mentioned in our first interaction, those three commands must be run one at a time. Run the first, then the second, then the third. You cannot run all of them at once. It will not work.

Then run the file.
Customer: replied 4 years ago.

Ok. I did it, but it says no customer db to drop. I dropped a different way. Then I ran the other two commands, (individually) . Then I imported the newdb.sql. this is the error I am getting.



I got the DB loaded I think.


I am getting this error, when I try to log in.


Please send me a link so that I may join you.

Thank you
Customer: replied 4 years ago.

You need to spend $3 to view this post. Add Funds to your account and buy credits.
TheDoctor and other Homework Specialists are ready to help you
Customer: replied 4 years ago.
I am unable to add inventory to the database
Do you mean through the web site?

There was no requirement to enable adding inventory through the web site in this question.

If you are attempting to do it through the database, then it has to be done correctly. Your tables are now in a proper relational-database format.

So, you would go to the product list table first because the inventory has a dependency on the product list table. You would insert the product. Give it something like product id 2, or don't even enter a product ID because it is auto_incrementing.

You can use phpmyadmin's insert page to insert into the product list table. Insert whatever you want and take a look at the product ID that is assigned.

Then go to the inventory table, and enter the product id, of that new product and all the other information for the inventory table. Once you have the inserted row into both tables, the inventory will show up on the inventory page.

This is the correct way to implement a relational database, as previously described.
Customer: replied 4 years ago.

I am making the form on the admin page, to enter the product into the inventory, instead of using myphpadmin.


I am getting this error using phpmyadmin



#1452 - Cannot add or update a child row: a foreign key constraint fails (`customers`.`inventory`, CONSTRAINT `fk_inv_vend` FOREIGN KEY (`vendor_id`) REFERENCES `vendor list` (`Vendor_ID`))
You have to satisfy the relation in your code also. A relational database is never set up to simply insert into a single file at one time. That would be a flat-file system. You would definitely lose points for that. It is fundamentally incorrect.

In your php, you would first insert a row into the product list table. That table has an auto_increment, so you do not insert the product_id. After using the mysqli object to insert the record into product list, you get the new insert id like this:

$product_id = $db->insert_id;

Then, you insert your row into the inventory table. You do both after form submission. It requires two queries. All database-driven sites work this way. Almost all form posts require inserts into 2 or more tables.
Customer: replied 4 years ago.

I can use your account creation php to look of. I made the form.


I notice the admin page is different for the customer login. Where is that located so I can, add the Inventory Form I created. Then I have to get the code right for the form to submit to the database...

Only the admin account has access to the admin page. Otherwise, customers could approve their own orders.
Customer: replied 4 years ago.



"Only the admin account has access to the admin page"


Is this done through Permissions?


I found menu.php and change place quotation to my form. Below is the form snapshot. I matched the fields with the product database.




It is done through the account type, just as all the other account types are done.

The form looks fine.
Customer: replied 4 years ago.

am I going to have to use your functions.php

I'm not sure I understand at all what you are asking. You stated that the admin page is different for the customer login. I don't understand what you mean because there is no admin page for the customer login.

What are you asking?
Customer: replied 4 years ago.
When I logon with admin admin, the menu page is different.
Admin has access to all menu items because they are the admin.

One of the requirement listed in last week's assignment was that the different customer types have access to specific pages. So customers have access to only certain pages. If customers and admin had access to the same items, the site would not meet the requirements from last week.
Customer: replied 4 years ago.
Haha. I understand that. I mean did u just do it by creating permissions to the pages I the database .
Notice how every page starts with:

$acct = checkUser();

And then it checks if $acct is set, and what the value is. If it is not a value that should have access to the page, it redirects.

Notice in menu.html, every menu item is dependent on the $acct value.

1 is a customer
2 is a vendor
3 is a distributor
99 is admin
Customer: replied 4 years ago.
That is awesome. Ok I am going to work on the form and sending to db and updating the inventory table... Any suggestions. Thanks you are awesome
Customer: replied 4 years ago.
I can not get your inventory db to update the table... Let alone my form to update the inventory db
Hello again,

Keeping the Inventory and Product List table that you had was absolutely not an option. You had a recursive foreign key, which would cause a fatal error whenever you tried to place an order. And placing an order was a requirement for the emails. In addition, you were violation first normal form, which would make most instructors fail you. First Normal Form is the most basic rule of a relational database. Violating means that the database has absolutely no integrity.

In order to work with a relational database like this, you are going to have to perform JOINs on the tables. I can take a look at what you have done. Simply enter a new question, starting it with **For TheDoctor**. I will review what you have attempted to do, correct anything that needs corrected, and explain it for you.

Related Homework Questions