dbdavis55
-
Posts
4 -
Joined
-
Last visited
Posts posted by dbdavis55
-
-
Here is my assignment:
I just need help with creating this application. Please can you help me.
The goal of this program is to create a CRUD application for the MySQL database table recipe with this definition:
The title field is a simple one-line designation and the description represents the instructions in HTML format. The SQL type text, used for the recipe's description, is meant to be used for general, multi-line text content. Program SetupWithin your roadrunner public_html directory, the following directory has already been created.prog4Log in to your account via a secure-shell client.id int auto_increment primary key not null,
title varchar(255) unique not null,
description text not null- Install the database initialization file include/db.php. The easiest thing to do is to copy/paste it from things, either through Dreamweaver, or from the shell:$ cd public_html
$ cp things/include/db.php prog4/include/
Lastly you can create it from scratch as:include/db.php<?php
require_once "rb.php";
$db = "dd750782";
$user = "dd750782";
$pass = "dd750782";
$url = "mysql:host=localhost;dbname=$db";
R::setup( $url, $user, $pass );
R::freeze( true );select - Run the database setup script:$ cd ~/public_html/prog4
$ php setup/make_recipes.php - Edit validate.php and modify the password to a value you want.
add.php
modify.php
Some general points are:- Forms whose actions add, modify, or delete records must use the POST method; modify is likely to fail if you use the GET method!
- Avoid notices without weakening the error_reporting status.
- All reentrant activations should have sticky form fields.
- Other than choice of colors, make your the presentations be as indicated by the screen shots below. Visual effects should be made, whenever possible, using style rules. In particular, use width and height style properties to control the sizes of textfields and textareas.
- The intention of this program is that it be "responsive" in the sense that fields can scale down as the browser width changes. Make good use of percentages for widths.
contains one recipe, Easy_Meatloaf.txt, that you can use for testing. Download it (e.g., WinSCP) to your client, open it (e.g. NotePad++) and add it with a variety of titles. TextareaThe add form indicated below consists of a textfield for the title and a textarea for the description. The textarea code within the form should look something like this:Points to note about this usage are:<textarea name="description" spellcheck="off"><?php echo ... ?></textarea>- there should be no superfluous white space characters (newlines or otherwise) between the start and end textarea tags
- the spellcheck="off" attribute setting is useful to avoid having the HTML-based content flagged (I know of no way to achieve this effect through style properties)
- It must have at least 3 characters (when trimmed).
- It must be unique among recipe titles.
description: I don't have to write it now
Submit it, redirecting to show the result: Modify/Remove a recipe: modify.phpPressing the Modify/Remove button when a recipe is presented activates modify.php. We want both the title and the description to be modifiable. The contents are loaded into form similar to that used in add: RemovePressing the Remove button effects a removal of the recipe. Activation of removal should be protected by user confirmation as done in the thingsapplication. If confirmed, delete the recipe and redirect to the home page (with nothing selected). ModifyPressing the Modify button should effect changes to the fields. The behavior is basically the same as for add; in particular, although they are less likely to occur in practice, these could happen, causing an error:- the user could attempt to reduce the title length to under 3 characters
- the user could attempt to change the title to that of another recipe
- Install the database initialization file include/db.php. The easiest thing to do is to copy/paste it from things, either through Dreamweaver, or from the shell:$ cd public_html
-
I have a drop down menu with items and my buttons set up. I need help when clicking on the items in the list to show the total to the total box. Here is what I have so far:
stdClass Object ( )Log out
Takeout Orders Start Over Items: Nachos Buffalo Wings Egg Rolls Tostada Chips Chicken Fajita Salad Spinach Salad Chicken Caesar Salad Margarita Grilled Chicken Margarita Grilled Tuna Grilled Pork Chops Bacon Burger OldTimer Burger Mushroom-Swiss Burger
Your Order Item Price qty Order Total: $0.00<?phprequire_once "include/Session.php";$session = new Session();if (!isset($session->valid)) {require_once "login.php";exit();}require_once "include/menu.php";/* DO NOT MODIFY THE ABOVE LINES !!!!! */$params = (object) $_REQUEST;print_r($params);/* Remaining Php handler code goes here */?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>Takeout Orders</title><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>Takeout Orders</title><style type="text/css">body {padding: 20px;}#logout {position: absolute;top: 40px;right: 40px;#items {width:250px;height: auto;padding:25px;border:10px black;margin:20px;}#order {width:250px;height:auto;padding:25px;border:10px black;margin:20px;}#items_list {width:150px;height:auto;padding:20px;border:30px red;margin:auto;}}</style></head><body><a id="logout" href="logout.php">Log out</a><h2>Takeout Orders</h2><form action="program.php" method="get"><button type="submit">Start Over</button></form><form action="program.php">Items:<select name="menu_item"><option>Nachos </option><option>Buffalo Wings </option><option>Egg Rolls </option><option>Tostada Chips </option><option>Chicken Fajita Salad </option><option>Spinach Salad </option><option>Chicken Caesar Salad </option><option>Margarita Grilled Chicken </option><option>Margarita Grilled Tuna </option><option>Grilled Pork Chops </option><option>Bacon Burger </option><option>OldTimer Burger </option><option>Mushroom-Swiss Burger </option></select><br /><br /><input type="submit" name="add" value="Add One" /><input type="submit" name="remove" value="Remove All of Selected" /></form><br /><div id="order"><h3>Your Order</h3><table width="250" height="55" id="items_table"><tr><th>Item</th><th>Price</th><th>qty</th></tr><tr><td><strong>Order Total: $0.00</strong></td></tr></table></div><!-- Add form and presentation code --></body></html>I need to do this still:DescriptionThe goal of this program is to create a simplistic web page for creating a takeout order, which is a list of food items, their individual prices and the quantity of each. A total price is also computed. These snapshots (using Firefox on Mac OSX) represent a sample run.The user chooses "Egg Rolls" and presses the Add one button twice:
One "Bacon Burger" and three "Chicken Fajita Salad" additions later:
The user chooses "Egg Rolls" and presses the Remove all of selected button:
-
I need help writing PHP code for this class I have. I'm new to PHP and can't quite understand it. Can anyone please help me. Here is the assignment:
http://www.cs.wcupa.edu/rkline/wpeval/program-3.html
Creating a CRUD application for the MySQL database
in PHP Coding Help
Posted
I'm trying to include the menu items to a drop down list so the user can select the menu item and display the recipe.