Tracking items ordered ....One day I'll know it all

They have: 105 posts

Joined: Jan 2002

Hello everyone, tis I...again...

I've produced a wizard so taht users can select the hosting, design and domain registration options on my site, but cannot figure out what the best way is for the order to create an order summary. I've tried to send a variable called order summary from page to page, appending new items to the order summary array, but I must be doing something wrong because it's not working.

Do anyone have a suggestion on how to track and append to a customer's order through 5 pages without using a shopping cart?

The current design can be found at http://www.cprhosting.com/wizard.php

If all goes well, it should land you at a list page (not a payment page)

CPRhosting.com - CPR Hosting...Giving life to the web
Custom-made Hosting Plans starting at $2

They have: 8 posts

Joined: May 2002

I'm assuming that you want to make this so that, if you select one or more items in step 1, the appropriate data entry boxes will appear on the one page (it's not much different if you want each on a seperate page).

This is actually not a trivial problem. I remember starting out with PHP trying to do things like this (oh so long ago Smiling ), and failing miserably. So I'll give you a few pointers to start you off.

There are actually several ways to solve this problem. Probably the simplest method is to use HTML Forms with PHP. With this method, you'll want to use lots and lots of tags, and make sure you specify your FORM tag like , so that you don't have to send a really long URL to the browser, but you may want to leave a parameter such as ?step=2, so that people know where they're up to. There is some useful documentation in the PHP manual (http://www.php.net) about using Forms & PHP, and particularly some info on Forms and arrays.

Another way would be to use a database. This is a significant step up from the Forms method above, but for complex tasks it can make everything much easier. The MySQL (http://www.mysql.com) and PHP docs don't really cover this much, and I taught myself this by tearing appart php-nuke and other database-driven systems Wink. But there are increasingly more resources available.

You could also use PHP's Sessions (like the s=..... numbers in this forum's URL). I don't have much experience with these, so you'll need to find somebody else to help out. Similarly, you can use Cookies to do this, but many people don't trust cookies, so your mileage here may vary considerably.

Have fun!
arin

Web hosting from just $2 a month! http://www.xeosdd.net

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

My personal choice would be to use a DB. But using the GET method (as it looks like your using) should do just fine.

It looks like your loosing data from previous pages by not including them in the forms. You need to add hidden fields in your forms to keep the data. Such like...

( page 2 )
<form action="blah.php" method="GET/POST">
    <input type="hidden" name="services[]" value="Design" />
    <input type="hidden" name="services[]" value="Logo" />
    <input type="radio" name="logo" value="yes_logo" checked>Continue with professional design<br>
    <input type="radio" name="logo" value="no_logo" >Cancel logo request<br><br><input TYPE=submit NAME=submit VALUE="Go to Step 3 >>" >
</form>
'

Mark Hensler
If there is no answer on Google, then there is no question.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.