Advanced Web / PHP Action Lab Recap
- Download the demo Shopping cart from http://ww2.coastal.edu/chadc/php.zip
- Verify your ww2 account is active. Go to: http://ww2.coastal.edu/username. You should see a page that states under construction.
- Connect to your ww2 account with Windows Explorer (or any other FTP program) to allow your pages/file to be published to the word. Go to the address ftp://username@ww2.coastal.edu in Windows Explorer. Use your CCU username and password to login.
- Create a folder "php" in your ww2 account. The folder name IS CaSeSeNsItIvE!
- Drag and drop your files from your computer into the php folder in your ww2 account. This FTPs your files to the server and publishes them for the world to see.
- View your files in your ww2 account open Internet Explorer / Firefox. Go to the address http://ww2.coastal.edu/username/php/form1.php
- At this point you can modify form1.php and form2.php on your computer with WordPad. After each update - upload the files to the ww2 server again and you can then refresh your browser to see the changes.
You can view the original files in working order here: form1.php and form2.php
Challenges
Challenge #1: Add another product to the shopping cart.
- Use the image located at http://ww2.coastal.edu/chadc/images/golfballs.jpg. Just use the URL, no need to download to keep locally.
- Add the product under the existing one. (form1.php)
- Allow the user to order: 0 boxes, 1 box, 2 boxes, 3 boxes, 5 boxes or 10 boxes. (form1.php)
- Each box should cost $4.75. (form1.php)
- The shopping cart should display an accurate subtotal for the putter, a subtotal for the balls and then grand total. (form2.php)
Challenge #2: Modify the form to require particular fields.
- If required fields are missing, the cart should display error messages instead of the order summary. (The message should instruct them use the Back Button to correct the errors. It does not have to handle redisplaying the form with the errors flagged unless you think you are up for the challenge!)
- Required fields:
First Name, Last Name, Email, Name on Card, Card Number, Security Code and Expiration Date