Archive for June, 2008

Web server iis - . cbashop.php: Acts as the home page for

Tuesday, June 10th, 2008

. cbashop.php: Acts as the home page for your little store and lists your available products. . getprod.php: Retrieves detailed information about a single product. . modcart.php: Adds, deletes, or changes quantities of a product to your shopping cart. Also empties the shopping cart completely. . cart.php: Displays the contents of your shopping cart. . checkout.php: The first step in the checkout process; this is where the customer enters billing and shipping information. . checkout2.php: The second step in the checkout process; this is where customers verify the accuracy of their orders and make any last-minute changes. . checkout3.php: The final step of the checkout process, where the customer actually sends the order to you, and receives an order number and confirmation. The information is put into the database and deleted from the temporary table, a customer number is assigned (if it s a new customer), and an order number is assigned, as well. E-mail confirmations are sent to the customer and to you. Try It Out Defining the Database and Tables In this exercise you ll create a run-once script that creates the database and tables for this chapter s project. 1. Open your text editor and type the following code: ; } else { echo Sorry, try creating the database again. ; } mysql_select_db( ecommerce ); //Define the product table $query = CREATE TABLE products ( products_prodnum CHAR(5) NOT NULL, products_name VARCHAR(20) NOT NULL, products_proddesc TEXT NOT NULL, products_price DEC (6,2) NOT NULL, products_dateadded DATE NOT NULL, PRIMARY KEY(products_prodnum)) ; $product = mysql_query($query) or die(mysql_error()); //Define the customer table $query2 = CREATE TABLE customers ( 520 Chapter 15
If you are in need for chaep and reliable webhost to host your website, our recommendation is http web server services.

. Superhero suits customizable with color schemes and (Web design rates)

Monday, June 9th, 2008

. Superhero suits customizable with color schemes and monogrammed torso letters . Two different types of grappling hooks for all our superheroes needs You will be expanding on these products later and adding them to your product catalog (that is, the products table in your database). A Shopping Cart Now that you know what you are going to sell, you have to have some way for your customers to choose the specific products they want to buy; this involves a shopping cart. You can hook yourself up with ready-made shopping cart software, or you can use a cart straight from a programming script, such as PHP (or CGI, or whatever). Because we re on this topic, we may as well get a little crazy and talk a little bit about the pros and cons of each. Shopping Cart Software Numerous shopping cart software programs are available that can easily hook your customers up and make it easy for them to pick what they want. Although these programs can be expensive, they can also take care of things such as security, complex product option selection, maintaining customer information, and keeping track of previously placed orders. An example of shopping cart software is Cart32. Available at www.cart32.com, this is a widely used shopping cart program that provides numerous configuration options for a Webmaster. Features include Webbased administration of your cart and pending/sent orders, the ability to use your own database or theirs to store product and customer information, automatic credit card processing and e-mail confirmations, complex product options and discount structures, online tracking through the major shipping carriers for your customers to track their orders, inventory management, and customization of the look of your cart. The costs are $29.95 to set up and $29.95 per month if you have Cart32 host the cart portion of your site for you. Many Web hosting companies have chosen Cart32 for the cart they offer to their customers. These types of software programs are popular because they enable you to get your store up and running with relative ease and because they take care of the security issues for you. Your Own Cart Software Code Remember that whenever you depend on someone else to supply a portion of your site, you are at the mercy of their servers and their software. If they are hosting your shopping cart for you, when their site is down, so is yours. If their servers catch a virus, it affects you and your customers, too. Plus, there may be a function you need that they don t offer, or the cost may be prohibitive for your newly created site. Whatever the reason, you may want to code your own script, and if you are brave enough to tread these waters, let s go! You ll start with a very simple shopping cart system that will consist of several files: . create.php: Creates the main database and the necessary tables. . createtemp.php: Creates a temporary table to store shopping cart information before the customer actually checks out. . products.php: Populates the database with product information. 519 Online Stores
From our experience, we are can tell you that you can find a reliable and cheap webhost service at Java Web Hosting services.

Abyss web server - Adding E-Commerce to the Comic Book Fan Site

Sunday, June 8th, 2008

Adding E-Commerce to the Comic Book Fan Site It s time to show you how you can easily incorporate an e-commerce section on your Comic Book Appreciation fan site. You will need a few things to get started: . Something to sell . Some mechanism for your customers to pick what they want to buy . Some way for your customers to pay for what they want to buy . Some process to get the merchandise to your customers Let s break it down (break dancing gear optional) and talk about each of these things individually. The first two we can help you with; the second two are really outside the scope of this book, beyond a general discussion. Something to Sell Before you can sell something, you have to have something to sell. Duh. Next topic. No, seriously, retailers spend millions researching what will sell and what won t, what the hottest trends are, and what the latest technology has to offer. All that being said, your ideas for products will probably come from one or more of the following categories: . Your own knowledge: You will most likely know what your customers want based on your inherent knowledge of the focus of your Web site. For example, if you have a site for collectors of old tractors, you probably know what products would appeal to your typical customer because you are the typical customer. . Something you yourself couldn t easily find: You also may have been looking for a specific product or group of products, only to find that they do not exist on one particular site until you create it and pull them all together. (For example, www.giftsforengineers.com was created to be a compilation of products that appeal to engineers.) . Your own inventions: Another item you might sell from your site is a new invention or design you have created from your little old brain. Many budding artists and inventors sell their stuff on the Web, where they can reach a multitude of potential buyers. . Promotion of your site: Many other Web sites offer promotional items for sale that tout the URL of their site. This acts as a win-win for both parties; the customers can proclaim their support for a cool site and the site makes a few bucks and gets its name out there for all to see. So whether you re reinventing the wheel, selling specific types of wheels, taking a bunch of wheels and putting them together, or selling wheels with your name on them, you must create a product base, and it may not be as easy as it looks. For your CBA site, you will be selling items from a few different categories. To spice things up a bit, we decided it would be great to have some fun with this: . T-shirts, bumper stickers, and coffee mugs with the CBA logo, from the promotional category 518 Chapter 15
Searching for affordable and reliable webhost to host and run your web applications? Go to our java web server services and you will be pleased.

15 Online Stores Some of us cringe when (Web hosting reseller)

Saturday, June 7th, 2008

15 Online Stores Some of us cringe when we hear the word e-commerce and the phrase selling over the Internet. Perhaps we ve had a bad experience ourselves, or the thought of opening an online store is just too overwhelming. Even though this is the part of the book that all geeks out there probably dread reading, we re here to show you that e-commerce is really not so bad, and that pretty much anyone can do it. However, just because anyone can do it doesn t mean it s always done the right way. Done the wrong way, your site can look downright cheesy, but done the right way, your site can look professional and inviting, and become an excellent resource for your visitors and potential customers. There are definite, if unwritten, guidelines for selling things over the Web and we want to make sure you do things the right way. Selling things from your Web site can not only make you some extra cash; it can enhance your relationship with your Web site visitors (if e-commerce is not your site s primary function). In the case of your comic book fan site, offering pertinent items can make your site more interactive and interesting and bring visitors back again to see what new items you have for sale. True comic book fans will appreciate the niche of items you are providing, especially if some of the items are unique or hard to come by. This chapter discusses the following: . Creating a simple shopping cart script . Other ideas to improve your script . E-commerce basics
We recommend cheap and reliable webhost to host and run your web applications: Coldfusion Web Hosting services.

Cheapest web hosting - Mailing List Ethics You should know about a

Thursday, June 5th, 2008

Mailing List Ethics You should know about a couple of ethical issues when dealing with the world of mailing lists, namely spam and opt-in/opt-out. This section represents our personal soap box for airing our opinions about them. A Word About Spam With the advent of the computer, mailing lists have been brought to a whole new level. Now you can be (and no doubt are) told on a daily basis that Candy really wants you to visit her Web site, and that a little blue pill will solve all of your personal problems. Yes, occasionally an e-mail sits in your Inbox informing you of new job postings, new posts on PHPBuilder.com, or tour dates for Jimmy Buffett. But we think you know what mailing lists are primarily used for: spam! For those of you just crawling out of a suspended animation chamber, spam is a term used to describe a shotgun approach to advertising. You simply send your e-mail advertisement to as many people as you possibly can, in the hopes that a certain small percentage of them will actually respond. What is our point? SPAM is a luncheon meat. You spell it in all capital letters, and you enjoy it on your sandwiches. Spam is another name for UCE, or unsolicited commercial e-mail. It is spelled in all lowercase, and we shun it. The bottom line: Don t use mailing lists to send spam. Your mother would be very disappointed. Opt-In versus Opt-Out You may have heard these terms before. What do they mean? To most of your users, probably not much. They simply answer the questions on your registration, read the fine print (as all users do, of course), and click the Submit button. However, you aren t a user any more. At least, not on your own site. You are the administrator. You need to understand the difference between opt-in and opt-out because it may mean the difference between annoyance and acceptance for your users. Opt-in and opt-out are fancy ways of saying What is the default choice for your users? Opt-in means the user is not currently scheduled to receive a specific newsletter, but he or she may opt to subscribe. Obviously, opt-out is the opposite your user will automatically receive notifications unless he or she opts to remove him- or herself from that mailing list. Why the difference? As the administrator, you may sometimes have to walk a fine line between satisfying your advertisers (the ones giving you money to keep your site alive) and your users (the ones visiting your site, keeping your advertisers happy by driving up the number of hits). If an advertiser pays you enough, you might agree to automatically send advertisements from that company unless the user explicitly chooses not to receive them (opt-out). However, you might have a newsletter you send once per week that contains, for example, details of comic conventions throughout the country (or even the world). Not all visitors to your site will be interested in that, but if any are, they can subscribe to the newsletter so they will always be notified (opt-in). 514 Chapter 14
If you are searching for cheap webhost for your web application, please visit MySQL5 Web Hosting services.

Web hosting domains - However, the user.php form forces you to take

Wednesday, June 4th, 2008

However, the user.php form forces you to take one extra step. You get the mailing list ID from the mailing list choice, but you have only an e-mail address for the user. Therefore, you will need to do a lookup with that e-mail address. As you ll no doubt recall, the Remove button on user.php loads the user_transact.php page, and when the action is Remove, you do a lookup for user_id based on the e-mail address, and build the URL for remove.php. You then redirect the user to remove.php with the correct parameters. Time for remove.php to do its job! You can t just assume that remove.php received the appropriate variables. You test to ensure they are set and run the DELETE query. if (isset($_GET[ u ], $_GET[ ml ])) { $sql = DELETE FROM ml_subscriptions . WHERE user_id= . $_GET[ u ] . AND ml_id= . $_GET[ ml ]; $result = mysql_query($sql, $conn); } else { die( Incorrect parameters passed for deletion ); } That was easy, but you still need to do a couple of things, like build the page. Don t quit on us now. Of course, first, you must make sure the deletion worked. Announce the results in big letters! if ($result) { $msg =

Removal Successful

; } else { $msg =

Removal Failed

; } Using the mailing list id, you do a lookup for the name of the mailing list and build the page s message: $ml_id = $_GET[ ml ]; $sql = SELECT * FROM ml_lists WHERE ml_id = . $ml_id . ; $result = mysql_query($sql) or die( Invalid query: . mysql_error()); if (mysql_num_rows($result)) { $row = mysql_fetch_array($result); $msg .= You have been removed from the . $row[ listname ] . mailing list.
; } else { $msg .= Sorry, could not find Mailing List id#{$ml_id} ; } Finally, you add a link back to user.php at the bottom of the page and echo it to the screen. $msg .= Return to Mailing List Signup page ; echo $msg; 513 Mailing Lists
Please visit Domain Name Hosting services for high quality webhost to host and run your jsp applications.

Web design company - $result = mysql_query($sql) or die( Invalid query: .

Tuesday, June 3rd, 2008

$result = mysql_query($sql) or die( Invalid query: . mysql_error()); if (mysql_num_rows($result)) { $row = mysql_fetch_array($result); $msg .= You have been removed from the . $row[ listname ] . mailing list.
; } else { $msg .= Sorry, could not find Mailing List id#{$ml_id} ; } $msg .= Return to Mailing List Signup page ; echo $msg; ?> 2. At the bottom of the e-mail you sent yourself is a link you can click to remove yourself from the mailing list. Now, click the link. You should see the Removal page (see Figure 14-5), with a message of success. If you send another message to that mailing list, the message should not be sent to your e-mail address. Figure 14-5 How It Works Auser can remove him- or herself from a mailing list in two ways. The first way is for the user to go to user.php, enter the e-mail address, choose the mailing list, and click the Remove button. The second way is via a link that you conveniently include at the end of e-mails that are sent to the mailing list recipients. The remove.php page requires two parameters, user ID and mailing list ID. You are removing a database record from the ml_subscriptions table, and you will recall that those two values are what make each record unique. You can easily get that data from the e-mail link; it s embedded as part of the URL. 512 Chapter 14
From our experience, we are can tell you that you can find a reliable and cheap webhost service at Java Web Hosting services.

Web design portfolio - Then comes the custom part of the message.

Monday, June 2nd, 2008

Then comes the custom part of the message. Currently, there are two types of Thank You messages: A confirmation request has been sent to . . . , and A subscription notification has been sent . . . switch ($_GET[ t ]) { case c : $msg .= A confirmation request has been sent . to $email.

; break; case s : $msg .= A subscription notification has been . sent to you at $email.

; } Finally, you finish the page by putting a link back to user.php, and displaying the page. $msg .= . Return to Mailing List Signup page ; echo $msg; Try It Out Removing Your Subscription Now that you ve given users the ability to add themselves to your mailing lists, you need to give them the ability to remove themselves when they want. 1. The e-mail that you sent yourself has a link on it allowing your users to remove themselves from the mailing list, if they desire. Enter that file now, and save it as remove.php:

Removal Successful

; } else { $msg =

Removal Failed

; } $ml_id = $_GET[ ml ]; $sql = SELECT * FROM ml_lists WHERE ml_id = . $ml_id . ; 511 Mailing Lists
Visit our web design programs services for an affordable and reliable webhost to suit all your needs.

Connect to the (Web design careers) database: $conn = mysql_connect(SQL_HOST, SQL_USER,

Sunday, June 1st, 2008

Connect to the database: $conn = mysql_connect(SQL_HOST, SQL_USER, SQL_PASS) or die( Could not connect to MySQL database. . mysql_error()); mysql_select_db(SQL_DB, $conn); Get user info based on the user id. If you find it, display the title Thank You, followed by the user s first name. Also grab the user s e-mail address. You ll use it later. if (isset($_GET[ u ])) { $uid = $_GET[ u ]; $sql = SELECT * FROM ml_users WHERE user_id = $uid ; $result = mysql_query($sql) or die( Invalid query: . mysql_error()); if (mysql_num_rows($result)) { $row = mysql_fetch_array($result); $msg =

Thank You, . $row[ firstname ] .

; $email = $row[ email ]; } else { die( No match for user id . $uid); } } Next, you get the listname, based on the mailing list id. If you find it, you build the message to include Thanks for subscribing. Once you get past this point, you know you have the user ID and mailing list ID. if (isset($_GET[ ml ])) { $ml_id = $_GET[ ml ]; $sql = SELECT * FROM ml_lists WHERE ml_id = . $ml_id . ; $result = mysql_query($sql) or die( Invalid query: . mysql_error()); if (mysql_num_rows($result)) { $row = mysql_fetch_array($result); $msg .= Thank you for subscribing to the . $row[ listname ] . mailing list.
; } else { die ( Could not find Mailing List $ml_id ); } } else { die ( Mailing List id missing. ); } Now all you have to do is determine the type of message you re displaying. if (!isset($_GET[ t ])) { die( Missing Type ); } It is crucial that the type be set. If not, stop processing this page. You don t know what to thank the user for. 510 Chapter 14
From our experience, we can recommend PHP Web Hosting services, if you need affordable webhost to host and run your web application.