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
TheDoctor, Professional w/Adv. Degree
Category: Homework
Satisfied Customers: 1479
Experience:  M.S. in Internet Information Systems
59032869
Type Your Homework Question Here...
TheDoctor is online now
A new question is answered every 9 seconds

Account Registration Proces:Create an account registration

Resolved Question:

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:
http:///acctregistration?acctname=&confirm=yes
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 toXXX@XXXXXX.XXX 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.
Submitted: 1 year ago.
Category: Homework
Expert:  TheDoctor replied 1 year ago.
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 http://ge.tt

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 1 year ago.

http://ge.tt/652qlgc/v/0


 


 


 


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

Expert:  TheDoctor replied 1 year ago.
Thank you,

I will contact you once this is complete.
Customer: replied 1 year 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...

 

 

Jeff

 

 

http://ge.tt/7Ylqpgc/v/0

 

database

Expert:  TheDoctor replied 1 year ago.
No problem. I will contact you once this is complete. It may be a day or so. Thank you.
Expert:  TheDoctor replied 1 year ago.
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 1 year ago.


Here is the entire DB and just the inventory.

 

http://ge.tt/6EALYnc/v/0

 

 

http://ge.tt/6EALYnc

 


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

Expert:  TheDoctor replied 1 year ago.
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 1 year ago.
Agreed. We can just add to the account creation page if u want. Just adding the email part and verification to that page.
Expert:  TheDoctor replied 1 year ago.
Yes, that is what I am doing.
Expert:  TheDoctor replied 1 year ago.
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 php.net

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 1 year ago.


Doc,


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


 


 


DROP SCHEMA customers;



CREATE DATABASE customers;



USE customers;


 


 


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

Expert:  TheDoctor replied 1 year ago.
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 1 year ago.

Expert:  TheDoctor replied 1 year 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 1 year 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.

 

Expert:  TheDoctor replied 1 year ago.
Please send me a link so that I may join you.

Thank you
Customer: replied 1 year ago.
Expert:  TheDoctor replied 1 year ago.
http://wikisend.com/download/323562/entire.sql
Expert:  TheDoctor replied 1 year ago.
THIS ANSWER IS LOCKED!
You can view this answer by clicking here to Register or Login and paying $3.
If you've already paid for this answer, simply Login.
TheDoctor, Professional w/Adv. Degree
Category: Homework
Satisfied Customers: 1479
Experience: M.S. in Internet Information Systems
TheDoctor and 2 other Homework Specialists are ready to help you
Customer: replied 1 year ago.
I am unable to add inventory to the database
Expert:  TheDoctor replied 1 year ago.
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 1 year 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`))
Expert:  TheDoctor replied 1 year ago.
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 1 year 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...

Expert:  TheDoctor replied 1 year ago.
Only the admin account has access to the admin page. Otherwise, customers could approve their own orders.
Customer: replied 1 year 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.


 


 


Attachments are only available to registered users.

Register Here

Attachments are only available to registered users.

Register Here

Attachments are only available to registered users.

Register Here
View Full Image

Attachments are only available to registered users.

Register Here


 

Expert:  TheDoctor replied 1 year ago.
It is done through the account type, just as all the other account types are done.

The form looks fine.
Customer: replied 1 year ago.


am I going to have to use your functions.php

Expert:  TheDoctor replied 1 year ago.
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 1 year ago.
When I logon with admin admin, the menu page is different.
Expert:  TheDoctor replied 1 year ago.
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 1 year ago.
Haha. I understand that. I mean did u just do it by creating permissions to the pages I the database .
Expert:  TheDoctor replied 1 year ago.
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 1 year 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 1 year ago.
I can not get your inventory db to update the table... Let alone my form to update the inventory db
Expert:  TheDoctor replied 1 year ago.
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.

JustAnswer in the News:

 
 
 
Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.
 
 
 

What Customers are Saying:

 
 
 
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
< Last | Next >
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
  • This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!! Alex Los Angeles, CA
  • Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult. GP Hesperia, CA
  • I couldn't be more satisfied! This is the site I will always come to when I need a second opinion. Justin Kernersville, NC
  • Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around. Esther Woodstock, NY
  • Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know. Robin Elkton, Maryland
  • He answered my question promptly and gave me accurate, detailed information. If all of your experts are half as good, you have a great thing going here. Diane Dallas, TX
 
 
 

Meet The Experts:

 
 
 
  • Manal Elkhoshkhany

    Tutor

    Satisfied Customers:

    4520
    More than 5000 online tutoring sessions.
< Last | Next >
  • http://ww2.justanswer.com/uploads/BU/BusinessTutor/2012-2-2_115741_Kouki2.64x64.jpg Manal Elkhoshkhany's Avatar

    Manal Elkhoshkhany

    Tutor

    Satisfied Customers:

    4520
    More than 5000 online tutoring sessions.
  • http://ww2.justanswer.com/uploads/LI/lindaus/2012-6-10_04811_IMG20120609164157.64x64.jpg Linda_us's Avatar

    Linda_us

    Finance, Accounts & Homework Tutor

    Satisfied Customers:

    3121
    Post Graduate Diploma in Management (MBA)
  • http://ww2.justanswer.com/uploads/ComputersGuru/2010-02-13_051118_Photo41.JPG LogicPro's Avatar

    LogicPro

    Engineer

    Satisfied Customers:

    3035
    Expert in Java C++ C C# VB Javascript Design SQL HTML
  • http://ww2.justanswer.com/uploads/lanis/2009-4-1_233717_phput9xef_c1pm.jpg Lani S.'s Avatar

    Lani S.

    Tutor

    Satisfied Customers:

    2457
    Registered Nurse, Internet Researcher, Private Tutor
  • http://ww2.justanswer.com/uploads/chooser77/2009-08-18_162025_Chris.jpg Chris M.'s Avatar

    Chris M.

    M.S.W. Social Work

    Satisfied Customers:

    2341
    Master's Degree, strong math and writing skills, experience in one-on-one tutoring (college English)
  • http://ww2.justanswer.com/uploads/JawaadAhmed/2009-6-27_12137_SIs_SHadi.jpg F. Naz's Avatar

    F. Naz

    Chartered Accountant

    Satisfied Customers:

    1975
    Experience with chartered accountancy
  • http://ww2.justanswer.com/uploads/JK/jkcpa/2011-1-16_182614_jkcpa.64x64.jpg Bizhelp's Avatar

    Bizhelp

    CPA

    Satisfied Customers:

    1873
    Bachelors Degree and CPA with Accounting work experience