Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_php thread: Shopping Cart Application


Message #1 by "dean powell" <dp2@d...> on Sat, 23 Feb 2002 04:04:52
Dean,

The link is valid for me.

I added a quick admin tool for your review:

	http://omnisphere.com/demo/shopcart/admin/items-admin.php

I created a thing called "code-gen" that can make a similar interface for
any table.

Roger



>Are you sure you have provided the correct link?
>
>>
>> 	http://omnisphere.com/demo/shopcart/
>>
>
>
>I would like to see the admin side for this cart.
>
>At the moment I have created a page to upload content to the database via
>a form handler for the book_shop.
>
>I have changed the arrays and database fields accordingly for the
>book_shop.
>
>This is the add.html file:
>
>/----------------------- cut and paste -------------------------
><HTML>
><HEAD>
><TITLE>add</TITLE>
></HEAD>
><BODY>
><FORM ACTION="add.php" METHOD=POST>
>Item Number<INPUT TYPE=TEXT NAME="Array[item_no]" SIZE=20><BR>
>Item Type<INPUT TYPE=TEXT NAME="Array[item_type]" SIZE=20><BR>
>Title<INPUT TYPE=TEXT NAME="Array[title]" SIZE=20><BR>
>Author<INPUT TYPE=TEXT NAME="Array[author]" SIZE=20><BR>
>Price<INPUT TYPE=TEXT NAME="Array[price]" SIZE=20><BR>
><INPUT TYPE=SUBMIT NAME="SUBMIT" VALUE="Submit!">
></FORM>
></BODY>
></HTML>
>/---------------------------- cut and paste --------------------
>
>
>This is the add.php file that handles the form add.html
>
>/---------------------------- cut and paste --------------------
><HTML>
><HEAD>
><TITLE>Inserting Data into a Database</TITLE>
><BODY>
><?php
>/* This page receives and handles the data generated by "add.html". */
>// Trim the incoming data.
>
>require 'functions.php';
>
>$Array["item_no"] = trim ($Array["item_no"]);
>$Array["item_type"] = trim ($Array["item_type"]);
>$Array["product_name"] = trim ($Array["product_name"]);
>$Array["manufacture"] = trim ($Array["manufacture"]);
>$Array["price"] = trim ($Array["price"]);
>
>// Set the variables for the database access:
>$Host = "localhost";
>$User = "insert your username";
>$Password = "insert password";
>$DBName = "insert the database name";
>$TableName = "book_shop";
>
>$Link = mysql_connect ($Host, $User, $Password);
>$Query = "INSERT into $TableName values ('$Array[item_no]', '$Array
>[item_type]', '$Array[title]', '$Array[author]', '$Array[price]')";
>print ("The query is:<BR>$Query<P>\n");
>if (mysql_db_query ($DBName, $Query, $Link)) {
> 	print ("The upload was successfully executed!<BR>\n");
>} else {
> 	print ("The upload could not be executed!<BR>\n");
>}
>mysql_close ($Link);
>?>
></BODY>
></HTML>
>
>
>/---------------------------- cut and paste --------------------
>
>This is very basic but you could link from the admin to the add.html file.
>There are a few more important coding to add like the return path back to
>the admin page.  I will continue to develop this further at phpnukes.co.uk


--------------ROGER JACOBS - DATA SYSTEMS CONTRACTOR ----------------
DataSpace Industries                    mailto:raj@o...
4491 Rice Street, Suite 102             http://www.omnisphere.com
Lihue, HI  96766                        See Kauai Products & Services:
xxx-xxx-xxxx      FAX-246-4725           http://www.lauhala.com






  Return to Index