Forum Moderators: coopster

Message Too Old, No Replies

Multiple page order form

         

Webber

5:24 am on Mar 25, 2008 (gmt 0)

10+ Year Member



I had a single page form, which was quite long.
My colleage suggested to use a multiple page form. In that case, if someone would not fill out completely, I would have the first entered data, which contains the email address. I could then contact them and get the sale anyway.
Very good idea!

Now, I have created a multiple page form and it works! All the data goes nicely into the database. However, I do need the form to send me an email with the data, so I can take care of the order.
And that does not work any more.

The email will state only the data of the last page. I guess that it does not remember the data from previous pages. Or that I need to refer to it again, or 'GET' it from the database.

How do I do it?

lexipixel

6:01 am on Mar 25, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Pass it along in hidden fields to the next form;

FORM 1:

<form action="step1">
Name: <input type="text" name="uname">
Phone: <input type="text" name="uphone">
Email: <input type="text" name="uemail">
<input type="submit" value="submit">
</form>

Parse data from first form and pass into sencond, e.g.-

FORM 2:

<form action="step2">
<input type="hidden" name="uname" value="John Q. Public">
<input type="hidden" name="uphone" value="555-555-1212">
<input type="hidden" name="uemail" value="jqp@example.tld">
Card Type: <input type="text" name="cardtype">
Card Number: <input type="text" name="cardnum">
<input type="submit" value="submit">
</form>

I would collect the card info on the last step -- get their name, phone, email etc.. ahead of time, and the financial at the end so it isn't floating around cyberspace in hidden form fields.

Habtom

6:03 am on Mar 25, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sessions and Cookies can come into play as well.

dreamcatcher

7:48 am on Mar 25, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Personally I would follow Habtom`s advice and use sessions. That can come in handy if you want your visitor to go to a specific form page to re-edit. Just assign your post vars to the same session vars when you process each form.

foreach ($_POST AS $key => $value) {
$_SESSION[$key] = $value;
}

For the e-mail, loop through the session array key/values to build your e-mail message:

dc

henry0

10:50 am on Mar 25, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Also keep in mind that whatever will be the input src,
POST, GET, SESSIONS, COOKIES, HIDDEN
Do not assume the values to be clean, therefore test each input to make sure they are what you expect to be. (if a field is supposed to be a number verify that it's not [a-z] etc...)
last before entering input in your DB use any CleanDb() dealing with mysql_real_escape_string

lexipixel

6:36 pm on Mar 25, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Going back to Webber's original post:

I had a single page form, which was quite long.
My colleage suggested to use a multiple page form. In that case, if someone would not fill out completely, I would have the first entered data, which contains the email address. I could then contact them and get the sale anyway. Very good idea!

It is a good idea... I see a lot of carts promoting "1 Page Checkout" as a a feature or imrpovement - but as you've discovered, if they don't complete the form and abandon the cart, you have nothing. I like the idea of getting the cart contents and the user's name and contact info, THEN getting them to enter payment info.

One thing Webber mentioned was writing to the DB after each form "section" is submitted -- this needs to be thought out... Do you want incomplete orders in the ORDERS db ? Do you want to handle them differently, (e.g. a temporary db) ?

Anyway, it does helo with abandonded carts. I have one ecommerce client who routinely calls people and says, "I see you were attempting to checkout and didn't complete the order... Was there a problem? Can I help? " He closes a good number of sales this way.