Link to home
Start Free TrialLog in
Avatar of DJMgraphix
DJMgraphixFlag for United States of America

asked on

PHP help... Form to total denominations... then send to paypal

Hey Experts,
I need some help!

I have a form that contains dropdowns and text fields...I need to assign denominations to a few of the dropdowns then have the NEXT button redirect to another page containing a summarized and totaled form.  On that page will be a BUY NOW button to a paypal account.

Can someone please help!

Thanks in advance,
DJM
Avatar of gamebits
gamebits
Flag of Canada image

Can you show some code so we have something to start with?
Avatar of DJMgraphix

ASKER

what I have right now is located here, but the options are changing:

http://www.djmgraphix.com/THE_ART_BUCKET/paypal_test.html

The problem is that paypal doesn't accept this kind of scripting... it can only take one TOTALED price in a form...  as opposed to caclulating it...

I'm creating the options right now...


With php it should be fairly easy to do, you could display the information like a bill of sale and have the button buy now at the bottom.
Hey GAMEBITS:

Here is what I would like the dropdowns to be: (I think I can edit them in the future for when products change... I just need to see a good finished PHP before I can edit a little)




DESIGN 1 (Name of Form "will edit")
Dropdown1:
      Baby Onesies ($18.00)
      Baby Long-Sleeve ($18.00)
      Baby Bib ($10.00)
      Baby Short-Sleeve RABIT SKINS ($15.00)
      Mens Short-Sleeve ($20.00)
      Mens Long-Sleeve ($23.00)
      Zip-Up Hoodie ($35.00)
      Hoodie ($32.00)
      Womens Short-Sleeve ($20.00)
      Womens Tank-Top ($22.00)
      Womens Long-Sleeve ($25.00)
      Womens Cheer Shorts ($22.00)
      Tote Bag ($20.00)
      Gym Bag ($25.00)
      Trucker Hat ($18.00)
      Flat Brim Hat ($18.00)
      Can Koozie ($8.00)
      Sweatband ($8.00)
Dropdown 2:
      Haines Beefy T
      100% Cotton
Sizes:      
      Small
      Medium
      Large
      XL
      2X (+$3.00)
      3X (+$3.00)
Color:
      White
Black
Lettering Style:
      Script
      Plain
      Rock n Roll
      Box / Graffiti
      Painted
Name For Personalization (text field single line)
Design Colors You Want To See (text field single line)
Special Instructions For The Artist (text field multi line)

NEXT BUTTON


After the Next Button is chosen it is redirected to one last page with the summery and total of the complete order.

BUY NOW BUTTON
Linked to paypal account.  (paypal has to get all of the information to as well as total so we can see what they ordered)

Shoot.. I left one out... sorry:





Product Options:
      Baby Onesies ($18.00)
      Baby Long-Sleeve ($18.00)
      Baby Bib ($10.00)
      Baby Short-Sleeve RABIT SKINS ($15.00)
      Mens Short-Sleeve ($20.00)
      Mens Long-Sleeve ($23.00)
      Zip-Up Hoodie ($35.00)
      Hoodie ($32.00)
      Womens Short-Sleeve ($20.00)
      Womens Tank-Top ($22.00)
      Womens Long-Sleeve ($25.00)
      Womens Cheer Shorts ($22.00)
      Tote Bag ($20.00)
      Gym Bag ($25.00)
      Trucker Hat ($18.00)
      Flat Brim Hat ($18.00)
      Can Koozie ($8.00)
      Sweatband ($8.00)
Design Options:
      Design and Name on Front
      Design and Name on Back
      Design on Front and Name on Back (+$6.00)
      Design on Back and Name on Front (+$6.00)

Material:
      Haines Beefy T
      100% Cotton
Sizes:      
      Small
      Medium
      Large
      XL
      2X (+$3.00)
      3X (+$3.00)
Color:
      White
Black
Lettering Style:
      Script
      Plain
      Rock n Roll
      Box / Graffiti
      Painted
Name For Personalization (text field single line)
Design Colors You Want To See (text field single line)
Special Instructions For The Artist (text field multi line)

NEXT BUTTON


After the Next Button is chosen it is redirected to one last page with the summery and total of the complete order.

BUY NOW BUTTON
Linked to paypal account.  (paypal has to get all of the information to as well as total so we can see what they ordered)

If I'm not mistaken Paypal has a limit of the number of variables you can submit with the form (not sure if it is 2 or 4) nevertheless what we can do is concatenate variables to create one, give me a few minutes to put this together.
Paypal can accept only ONE PRICE variable... that's why I'm having this trouble...  So after the initial form... I have to have it redirected to a summary page with it already totaled... THEN paypal can accept it.
I was refering at the other options (size, color etc)
Oh... No they don't have any limit on those fields...
Just to give you an idea of what It will look like...

After you click on the design you want, you will be taken to the next page which will show the large picture of your design, then underneath that it will give pictures of the different, "PRODUCT OPTIONS".

To the RIGHT of the product options will be these DROPDOWNS..

Check it out here: http://www.djmgraphix.com/THE_ART_BUCKET/airbrush_apparel.html

Thanks
For the sake of discussion have a look here, working on the functionality, formating will come after.

http://www.cemond.com/EE/orderform.php

Also do you need to calculate sale taxes?
I have to charge 3% tax for NY state residence... how do you recommend doing that?

Oh SHOOT... "shipping"

After this order is sent to PAYPAL... will there be a place for shipping on there?

or do we have to tally that into here as well?

If so... we can use a flat rate shipping for now.
BTW!..... It's looking GREAT man!!!
We could add a checkbox that NY resident would have to tick and then the sale tax would be added to the total, or we could add another select box with all the states we can then assign a shipping value per state and automatically add the sale tax for NY residents.

What do you think?
I love the select box with all of the states to assign shipping value per state... which I can go back in later and edit.  as well as the NY sales tax addition.


Ok this part is done I added the shipping after the sale taxe for NY State, if you want (need) to add the sale tax on the shipping as well I can do that , let me know.
So I have the form added into the HTML file... which you can see here:

http://www.djmgraphix.com/THE_ART_BUCKET/airbrush_apparel/design1.html


2 questions...   because each form will be SLIGHTLY different... I will need on the summery page to have which design # it is coming from... I can add a title to each form I guess...

Also,
After you click on the next button... What can I add to my blank HTML page to keep the same theme going?

You are the man by the way... thank you.
You can pass information to the next page without user interaction (nuser won't even know about it) by using a hidden field

<input type="hidden" name="design_number" value="1234">

and on the receiving page

$design_number = $_POST['design_number']
The script most of it run on the server the table is the part showing on the browser.

<?php

//Get data from the form submission
$product = $_POST['product'];
$options = $_POST['options'];
$material = $_POST['material'];
$sizes = $_POST['sizes'];
$color = $_POST['color'];
$letstyle = $_POST['letstyle'];
$destination = $_POST['destination'];
$personalization = $_POST['personalization'];
$designcolor = $_POST['designcolor'];
$special = $_POST['special'];

//extract the price of the options selected
$price2 = array_filter(explode(' ', $product), 'is_numeric');
$options2 = array_filter(explode(' ', $options), 'is_numeric');
$sizes2 = array_filter(explode(' ', $sizes), 'is_numeric');

//shipping charge depending on destination
if($destination == 'AL'){$shipping = "5.00";}
 elseif($destination == 'AK'){$shipping = "5.00";}
  elseif($destination == 'AS'){$shipping = "5.00";}
   elseif($destination == 'AZ'){$shipping = "5.00";}
    elseif($destination == 'AR'){$shipping = "5.00";}
     elseif($destination == 'CA'){$shipping = "5.00";}
      elseif($destination == 'CO'){$shipping = "5.00";}
       elseif($destination == 'CT'){$shipping = "5.00";}
        elseif($destination == 'DE'){$shipping = "5.00";}
         elseif($destination == 'DC'){$shipping = "5.00";}
          elseif($destination == 'FL'){$shipping = "5.00";}
           elseif($destination == 'GA'){$shipping = "5.00";}
            elseif($destination == 'GU'){$shipping = "5.00";}
             elseif($destination == 'HI'){$shipping = "5.00";}
              elseif($destination == 'ID'){$shipping = "5.00";}
               elseif($destination == 'IL'){$shipping = "5.00";}
                elseif($destination == 'IN'){$shipping = "5.00";}
                 elseif($destination == 'IA'){$shipping = "5.00";}
                  elseif($destination == 'KS'){$shipping = "5.00";}
                   elseif($destination == 'KY'){$shipping = "5.00";}
                    elseif($destination == 'LA'){$shipping = "5.00";}
                     elseif($destination == 'ME'){$shipping = "5.00";}
                      elseif($destination == 'MD'){$shipping = "5.00";}
                       elseif($destination == 'MA'){$shipping = "5.00";}
                        elseif($destination == 'MI'){$shipping = "5.00";}
                         elseif($destination == 'MN'){$shipping = "5.00";}
                          elseif($destination == 'MS'){$shipping = "5.00";}
                           elseif($destination == 'MO'){$shipping = "5.00";}
                            elseif($destination == 'MT'){$shipping = "5.00";}
                             elseif($destination == 'NE'){$shipping = "5.00";}
                              elseif($destination == 'NV'){$shipping = "5.00";}
                               elseif($destination == 'NH'){$shipping = "5.00";}
                                elseif($destination == 'NJ'){$shipping = "5.00";}
                                 elseif($destination == 'NM'){$shipping = "5.00";}
                                  elseif($destination == 'NY'){$shipping = "5.00";}
                                   elseif($destination == 'NC'){$shipping = "5.00";}
                                    elseif($destination == 'ND'){$shipping = "5.00";}
                                     elseif($destination == 'OH'){$shipping = "5.00";}
                                      elseif($destination == 'OK'){$shipping = "5.00";}
                                       elseif($destination == 'OR'){$shipping = "5.00";}
                                        elseif($destination == 'PA'){$shipping = "5.00";}
                                         elseif($destination == 'PR'){$shipping = "5.00";}
                                          elseif($destination == 'RI'){$shipping = "5.00";}
                                           elseif($destination == 'SC'){$shipping = "5.00";}
                                            elseif($destination == 'SD'){$shipping = "5.00";}
                                             elseif($destination == 'TN'){$shipping = "5.00";}
                                              elseif($destination == 'TX'){$shipping = "5.00";}
                                               elseif($destination == 'UT'){$shipping = "5.00";}
                                                elseif($destination == 'VT'){$shipping = "5.00";}
                                                 elseif($destination == 'VI'){$shipping = "5.00";}
                                                  elseif($destination == 'VA'){$shipping = "5.00";}
                                                   elseif($destination == 'WA'){$shipping = "5.00";}
                                                    elseif($destination == 'WV'){$shipping = "5.00";}
                                                     elseif($destination == 'WI'){$shipping = "5.00";}
                                                      elseif($destination == 'WY'){$shipping = "5.00";}




//assign price to a variable
foreach($price2 as $value1){$pprice = "$value1";}
foreach($options2 as $value2){$poption = "$value2";}
foreach($sizes2 as $value3){$psizes = "$value3";}

//use the variables to do the calculation
$subtotal = $pprice + $poption + $psizes;
if($destination == 'NY'){$subtotal = $subtotal * 1.03;}
$subtotal = $subtotal + $shipping;
$total = number_format($subtotal, 2, '.', '');

//remove the price from the options (to display in item list)
$illegalchars_type_1 = array("1","2","3","4","5","6","7","8","9","0",".");
$product = str_replace($illegalchars_type_1,"",$product);
$options = str_replace($illegalchars_type_1,"",$options);
$sizes = str_replace($illegalchars_type_1,"",$sizes);

//displaying the choice, prices and total
echo "<table border=1 cellpadding=2 cellspacing=0 width=\"450\">
       <tr>
         <th>Product and Options</th>
         <th>Price</th>
       </tr>
       <tr><td>Product</td>              <td>$product</td>                       <td align=\"right\">$pprice</td></tr>
       <tr><td>Options</td>              <td>$options</td>                       <td align=\"right\">$poption</td></tr>
       <tr><td>Material</td>             <td>$material</td>                      <td>&nbsp;</td></tr>
       <tr><td>Size</td>                 <td>$sizes</td>                         <td align=\"right\">$psizes</td></tr>
       <tr><td>Color</td>                <td>$color</td>                         <td>&nbsp;</td></tr>
       <tr><td>Lettering Style</td>      <td>$letstyle</td>                      <td>&nbsp;</td></tr>
       <tr><td>Personalization</td>      <td colspan=2>$personalization</td></tr>
       <tr><td>Design Color</td>         <td colspan=2>$designcolor</td></tr>
       <tr><td>Special Instructions      <td colspan=2>$special</td></tr>
       <tr><td>Shipping to</td>          <td>$destination</td>                   <td align=\"right\">$shipping</td></tr>
       <tr><td>Total</td>                <td colspan=2 align=\"right\">$total</td></tr>
      </table>";

?>
Ok on the Design #...  as long as when the transaction is completed I can see all of the information in my paypal... I have a buy now button supplied by paypal with the account # etc...  

What do I have to do for the second page (summery page)
ohhh.. just saw that you wrote that... give me a minute to go over what you just wrote..

Thanks
Cool,

I'm heading home from work right now... I'll be back on in prob like 1 hours to try and wrap this up...

I've added the orderprocess.php to the server... I just need to make it look like my page still...

Then add the paypal buy now button..

Thanks man..
I'll talk to you soon.

DJM


PS... You are a life saver!
I should be around
Cool,
I'm back...

Can I take the table on the "orderprocess.php" page and put it a table on my HTML page to make it look right?


Ok,
Kinda answered my own question :)

I'll have everything personalized after I have the fun stuff done..

So I guess one of the things that are left is adding in my BUY NOW button...
Here is what paypal gives me as their BUY NOW button for my account
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="6430444">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>

Open in new window

To make it work you need to have a php extension, so if you just take the table and put it in a html file you will not get the result you are expecting. So to make it easy everything above //displaying the choice, prices and total should be at the top of your page than you can close the php script ?> put your html for your page and where you need the table to show up switch to php mode <?php use the echo statement with the table you can then close it again ?> and put the rest of your html.

Not sure if it make sense the way I say it but it is basically what need to be done.
Ha...  Wish that made sense...  So how I did it is wrong...  

Sorry for not understanding... You can see what I have right now if you go to the DESIGN1 page... then click next.
Not too bad we just need to make some adjustment.

for one you are missing what I would called the footer, you need to add the html for it after the table that display the order, the script worked as far as I can tell one small thing to fix is I chnage the value of the drop downn for the size from 2x and 3x to XX and XXX the reason is when I display the order I do not want to show 2X 3.00 and then the price again in the other column.
The table that I used to display the order is just a rough draft you can change the look of it as you wish, you just need to use the variables where appropriate.
I'm getting right now if you select the 2X or 3X  for size it only shows, "X".

How should I go about adding in the BUY NOW button?

I'm also not following when you say: "for one you are missing what I would called the footer, you need to add the html for it after the table that display the order"

I will definitly add stuff underneath the table.. I just want to get this working before I start personalizing the look of the page.


The look of the table is fine! :)

I just have to get this working!!

also...  I didn't understand the HIDDEN TEXT aspect where after the order is placed... I can see the DESIGN #  that goes with it.
I will have to look on Paypal to find out how to add more field to their form, the code you showed seems to be very basic, there should be a field for the price and also a few fields for product and options.
I was under the impression that we were adding our own dropdowns then just adding the button to tell it what account to go to.

You are the WIZARD! So I will follow what you say to the end of the earth when it comes to this stuff.

If you need me to call paypal... I can do that again if need be.
Just to let you know I'm still working on it, Paypal is not taking the amount entered for now.
You are the man...  I TRUELY TRUELY appreciate it! ...  

I know that you have the gist of what I'm going for...

I've got like 48 Hours to get this all done...

Thanks again... get yourself a beer... and I look forward to your response...
try the form again here

http://www.cemond.com/EE/orderform.php

click on the Buy Now button and we will talk about the problem I have after you tested it.
And here is the code for the button

<tr><td colspan=3 align=\"right\"><form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\" style=\"padding: 0px; margin: 0px\">
                           <input type=\"hidden\" name=\"cmd\" value=\"_s-xclick\">
                           <input type=\"hidden\" name=\"hosted_button_id\" value=\"6430444\">
                           <input type=\"hidden\" name=\"amount\" value=\"$total\">
                           <input type=\"hidden\" name=\"item_name\" value=\"$product\">
                           <input type=\"hidden\" name=\"item_number\" value=\"\">
                           <input type=\"hidden\" name=\"on0\" value=\"Options\">
                           <input type=\"hidden\" name=\"os0\" Value=\"$options\">
                           <input type=\"hidden\" name=\"on1\" value=\"Material\">
                           <input type=\"hidden\" name=\"os1\" value=\"$material\">
                           <input type=\"hidden\" name=\"on2\" value=\"Size and Color\">
                           <input type=\"hidden\" name=\"os2\" value=\"$sizes $color\">
                           <input type=\"hidden\" name=\"on3\" value=\"Lettering Style\">
                           <input type=\"hidden\" name=\"os3\" value=\"$letstyle\">
                           <input type=\"hidden\" name=\"on4\" value=\"Personalization\">
                           <input type=\"hidden\" name=\"os4\" value=\"$personalization\">
                           <input type=\"hidden\" name=\"on5\" value=\"Design Color\">
                           <input type=\"hidden\" name=\"os5\" value=\"$designcolor\">
                           <input type=\"hidden\" name=\"on6\" value=\"Special Instruction\">
                           <input type=\"hidden\" name=\"os6\" value=\"$special\">
                           <input type=\"image\" src=\"https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif\" border=\"0\" name=\"submit\" alt=\"PayPal - The safer, easier way to pay online!\">
                           <img alt=\"\" border=\"0\" src=\"https://www.paypal.com/en_US/i/scr/pixel.gif\" width=\"1\" height=\"1\">
</form></td></tr>
I see what you're saying... the totals don't go... as well as the Design# isn't on the description...

(FOR THE DESIGN #)  I can individualize each form title on all of the 48 design options... that's not a problem if that is the case...

Should I call paypal and try and see what they can help me with?


Also... Random question... what part of the world are you in?



So getting the information to the table isn't the issue... it's getting the TOTAL as well as the description to paypal is the problem... damn..  you would think paypal would be a little easier for this...
the problem (for me) is on this line

<input type=\"hidden\" name=\"cmd\" value=\"_s-xclick\">

the _s-xclick value means the form is protected from being tempered with, it is automatic when the button is saved on Paypal

if it was _xclick the total would go like anyother variables

-----------------------------------------------------------------------

We can use this variable

<input type=\"hidden\" name=\"item_number\" value=\"\">

for the design number, we just need to pass the value to the form

---------------------------------------------------------------------------

Canada, 9:00 pm now.
The maximum extra variables you can pass is 7 that is why I put 2 together (size and color) all the information is on the checkout page (other than the total).
Paypal people on the phone are slacking... I've spoken with them on the phone on may occations about this exact problem...  They said there is no lymit to the number of drop down var's, however just one $ var can be sent to them...

I'm sorry for giving you the wrong information in that case.

--------------------------------------------------

I hope you live somewhere near Mt. Tremblant... I'm from upstate NY... I love skiing there..


I used to live near Montreal, I've been a Mt. Tremblant a few time, I now live in Sarnia, Ontario
I love Montreal...  Used to go there when I wasn't 21 so I could drink...

Now I'm just an upstate New Yorker trying to make it as a freelance graphic designer... I mainly do printwork, or normal webdesign... this is my first website client who has SO many variables which is causing me this headache.
I can do programming not much of a graphic designer just a hobby anyway.
I hear ya...

I'm working on this site also right now... it's coming alone nice..

www.audioobsessions.com 

this THEARTBUCKET  is for an airbrush artist who lives in town... once I'm done with the sales page I'm done.... supposed to be done by the 30th...

like I said brother... I'm diein! :)
I'm done for the evening...

Thanks for everything today... hope we can work out the finalization tomorrow..

Thanks again.

DJM
www.djmgraphix.com
You will have to contact Paypal and find out why this is not working, here is an extract from their website explaining what the variable amount is;

"The price or amount of the product, service, or contribution, not including shipping, handling, or tax. If omitted from Buy Now or Donate buttons, payers enter their own amount at the time of payment."

It clearly says that if we omitted the variable "amount" the payers enter their own amount, I did not omitted the variable it's there on the fourth line of the button code so you need to find out why it is not picked up.
I've found a way to make it work, let me know when you are back online.
Excellent...  I'm here and ready to work.
Do you still want me to contact paypal?  I can if need be
No, I think we can do it without contacting them, here is the button as it is

<input type=\"hidden\" name=\"cmd\" value=\"_s-xclick\">
<input type=\"hidden\" name=\"hosted_button_id\" value=\"6430444\">
<input type=\"hidden\" name=\"amount\" value=\"$total\">
<input type=\"hidden\" name=\"item_name\" value=\"$product\">
<input type=\"hidden\" name=\"item_number\" value=\"\">
<input type=\"hidden\" name=\"on0\" value=\"Options\">
<input type=\"hidden\" name=\"os0\" Value=\"$options\">
<input type=\"hidden\" name=\"on1\" value=\"Material\">
<input type=\"hidden\" name=\"os1\" value=\"$material\">
<input type=\"hidden\" name=\"on2\" value=\"Size and Color\">
<input type=\"hidden\" name=\"os2\" value=\"$sizes $color\">
<input type=\"hidden\" name=\"on3\" value=\"Lettering Style\">
<input type=\"hidden\" name=\"os3\" value=\"$letstyle\">
<input type=\"hidden\" name=\"on4\" value=\"Personalization\">
<input type=\"hidden\" name=\"os4\" value=\"$personalization\">
<input type=\"hidden\" name=\"on5\" value=\"Design Color\">
<input type=\"hidden\" name=\"os5\" value=\"$designcolor\">
<input type=\"hidden\" name=\"on6\" value=\"Special Instruction\">
<input type=\"hidden\" name=\"os6\" value=\"$special\">
<input type=\"image\" src=\"https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif\" border=\"0\" name=\"submit\" alt=\"PayPal - The safer, easier way to pay online!\">
<img alt=\"\" border=\"0\" src=\"https://www.paypal.com/en_US/i/scr/pixel.gif\" width=\"1\" height=\"1\">
</form>

we need to change this
<input type=\"hidden\" name=\"cmd\" value=\"_s-xclick\">
to this
<input type=\"hidden\" name=\"cmd\" value=\"_xclick\">

we need to remove this line
<input type=\"hidden\" name=\"hosted_button_id\" value=\"6430444\">
and this line
<img alt=\"\" border=\"0\" src=\"https://www.paypal.com/en_US/i/scr/pixel.gif\" width=\"1\" height=\"1\">

we need to add another line
<input type=\"hidden\" name=\"business\" value=\"EMAIL ADDRESS\">
replace EMAIL ADDRESS with the email address of the account on Paypal

And everything should work

So with all the changes here is how it should look (other than the email address which I don't have

<form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\" style=\"padding: 0px; margin: 0px\">
                           <input type=\"hidden\" name=\"cmd\" value=\"_xclick\">
                           <input type=\"hidden\" name=\"business\" value=\"EMAIL ADDRESS\">
                           <input type=\"hidden\" name=\"amount\" value=\"$total\">
                           <input type=\"hidden\" name=\"item_name\" value=\"$product\">
                           <input type=\"hidden\" name=\"item_number\" value=\"\">
                           <input type=\"hidden\" name=\"on0\" value=\"Options\">
                           <input type=\"hidden\" name=\"os0\" Value=\"$options\">
                           <input type=\"hidden\" name=\"on1\" value=\"Material\">
                           <input type=\"hidden\" name=\"os1\" value=\"$material\">
                           <input type=\"hidden\" name=\"on2\" value=\"Size and Color\">
                           <input type=\"hidden\" name=\"os2\" value=\"$sizes $color\">
                           <input type=\"hidden\" name=\"on3\" value=\"Lettering Style\">
                           <input type=\"hidden\" name=\"os3\" value=\"$letstyle\">
                           <input type=\"hidden\" name=\"on4\" value=\"Personalization\">
                           <input type=\"hidden\" name=\"os4\" value=\"$personalization\">
                           <input type=\"hidden\" name=\"on5\" value=\"Design Color\">
                           <input type=\"hidden\" name=\"os5\" value=\"$designcolor\">
                           <input type=\"hidden\" name=\"on6\" value=\"Special Instruction\">
                           <input type=\"hidden\" name=\"os6\" value=\"$special\">
                           <input type=\"image\" src=\"https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif\" border=\"0\" name=\"submit\" alt=\"PayPal - The safer, easier way to pay online!\">

</form>
Very nice graphic design you are doing by the way.
Thank You,

I must have put the button in wrong...  because I have it uploaded right now on my server and I get an error message when I click on the next to get to the "orderprocess.php".

So I DEFINITELY added the button in wrong :)
<?php
 
//Get data from the form submission
$product = $_POST['product'];
$options = $_POST['options'];
$material = $_POST['material'];
$sizes = $_POST['sizes'];
$color = $_POST['color'];
$letstyle = $_POST['letstyle'];
$destination = $_POST['destination'];
$personalization = $_POST['personalization'];
$designcolor = $_POST['designcolor'];
$special = $_POST['special'];
 
//extract the price of the options selected
$price2 = array_filter(explode(' ', $product), 'is_numeric');
$options2 = array_filter(explode(' ', $options), 'is_numeric');
$sizes2 = array_filter(explode(' ', $sizes), 'is_numeric');
 
//shipping charge depending on destination
if($destination == 'AL'){$shipping = "5.00";}
 elseif($destination == 'AK'){$shipping = "5.00";}
  elseif($destination == 'AS'){$shipping = "5.00";}
   elseif($destination == 'AZ'){$shipping = "5.00";}
    elseif($destination == 'AR'){$shipping = "5.00";}
     elseif($destination == 'CA'){$shipping = "5.00";}
      elseif($destination == 'CO'){$shipping = "5.00";}
       elseif($destination == 'CT'){$shipping = "5.00";}
        elseif($destination == 'DE'){$shipping = "5.00";}
         elseif($destination == 'DC'){$shipping = "5.00";}
          elseif($destination == 'FL'){$shipping = "5.00";}
           elseif($destination == 'GA'){$shipping = "5.00";}
            elseif($destination == 'GU'){$shipping = "5.00";}
             elseif($destination == 'HI'){$shipping = "5.00";}
              elseif($destination == 'ID'){$shipping = "5.00";}
               elseif($destination == 'IL'){$shipping = "5.00";}
                elseif($destination == 'IN'){$shipping = "5.00";}
                 elseif($destination == 'IA'){$shipping = "5.00";}
                  elseif($destination == 'KS'){$shipping = "5.00";}
                   elseif($destination == 'KY'){$shipping = "5.00";}
                    elseif($destination == 'LA'){$shipping = "5.00";}
                     elseif($destination == 'ME'){$shipping = "5.00";}
                      elseif($destination == 'MD'){$shipping = "5.00";}
                       elseif($destination == 'MA'){$shipping = "5.00";}
                        elseif($destination == 'MI'){$shipping = "5.00";}
                         elseif($destination == 'MN'){$shipping = "5.00";}
                          elseif($destination == 'MS'){$shipping = "5.00";}
                           elseif($destination == 'MO'){$shipping = "5.00";}
                            elseif($destination == 'MT'){$shipping = "5.00";}
                             elseif($destination == 'NE'){$shipping = "5.00";}
                              elseif($destination == 'NV'){$shipping = "5.00";}
                               elseif($destination == 'NH'){$shipping = "5.00";}
                                elseif($destination == 'NJ'){$shipping = "5.00";}
                                 elseif($destination == 'NM'){$shipping = "5.00";}
                                  elseif($destination == 'NY'){$shipping = "5.00";}
                                   elseif($destination == 'NC'){$shipping = "5.00";}
                                    elseif($destination == 'ND'){$shipping = "5.00";}
                                     elseif($destination == 'OH'){$shipping = "5.00";}
                                      elseif($destination == 'OK'){$shipping = "5.00";}
                                       elseif($destination == 'OR'){$shipping = "5.00";}
                                        elseif($destination == 'PA'){$shipping = "5.00";}
                                         elseif($destination == 'PR'){$shipping = "5.00";}
                                          elseif($destination == 'RI'){$shipping = "5.00";}
                                           elseif($destination == 'SC'){$shipping = "5.00";}
                                            elseif($destination == 'SD'){$shipping = "5.00";}
                                             elseif($destination == 'TN'){$shipping = "5.00";}
                                              elseif($destination == 'TX'){$shipping = "5.00";}
                                               elseif($destination == 'UT'){$shipping = "5.00";}
                                                elseif($destination == 'VT'){$shipping = "5.00";}
                                                 elseif($destination == 'VI'){$shipping = "5.00";}
                                                  elseif($destination == 'VA'){$shipping = "5.00";}
                                                   elseif($destination == 'WA'){$shipping = "5.00";}
                                                    elseif($destination == 'WV'){$shipping = "5.00";}
                                                     elseif($destination == 'WI'){$shipping = "5.00";}
                                                      elseif($destination == 'WY'){$shipping = "5.00";}
 
 
 
 
//assign price to a variable
foreach($price2 as $value1){$pprice = "$value1";}
foreach($options2 as $value2){$poption = "$value2";}
foreach($sizes2 as $value3){$psizes = "$value3";}
 
//use the variables to do the calculation
$subtotal = $pprice + $poption + $psizes;
if($destination == 'NY'){$subtotal = $subtotal * 1.03;}
$subtotal = $subtotal + $shipping;
$total = number_format($subtotal, 2, '.', '');
 
//remove the price from the options (to display in item list)
$illegalchars_type_1 = array("1","2","3","4","5","6","7","8","9","0",".");
$product = str_replace($illegalchars_type_1,"",$product);
$options = str_replace($illegalchars_type_1,"",$options);
$sizes = str_replace($illegalchars_type_1,"",$sizes);
 
//displaying the choice, prices and total
echo "<table border=1 cellpadding=2 cellspacing=0 width=\"450\">
       <tr>
         <th>Product and Options</th>
         <th>Price</th>
       </tr>
       <tr><td>Product</td>              <td>$product</td>                       <td align=\"right\">$pprice</td></tr>
       <tr><td>Options</td>              <td>$options</td>                       <td align=\"right\">$poption</td></tr>
       <tr><td>Material</td>             <td>$material</td>                      <td>&nbsp;</td></tr>
       <tr><td>Size</td>                 <td>$sizes</td>                         <td align=\"right\">$psizes</td></tr>
       <tr><td>Color</td>                <td>$color</td>                         <td>&nbsp;</td></tr>
       <tr><td>Lettering Style</td>      <td>$letstyle</td>                      <td>&nbsp;</td></tr>
       <tr><td>Personalization</td>      <td colspan=2>$personalization</td></tr>
       <tr><td>Design Color</td>         <td colspan=2>$designcolor</td></tr>
       <tr><td>Special Instructions      <td colspan=2>$special</td></tr>
       <tr><td>Shipping to</td>          <td>$destination</td>                   <td align=\"right\">$shipping</td></tr>
       <tr><td>Total</td>                <td colspan=2 align=\"right\">$total</td></tr>
      </table>";
<form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\" style=\"padding: 0px; margin: 0px\">
                           <input type=\"hidden\" name=\"cmd\" value=\"_xclick\">
                           <input type=\"hidden\" name=\"business\" value=\"EMAIL ADDRESS\">
                           <input type=\"hidden\" name=\"amount\" value=\"$total\">
                           <input type=\"hidden\" name=\"item_name\" value=\"$product\">
                           <input type=\"hidden\" name=\"item_number\" value=\"\">
                           <input type=\"hidden\" name=\"on0\" value=\"Options\">
                           <input type=\"hidden\" name=\"os0\" Value=\"$options\">
                           <input type=\"hidden\" name=\"on1\" value=\"Material\">
                           <input type=\"hidden\" name=\"os1\" value=\"$material\">
                           <input type=\"hidden\" name=\"on2\" value=\"Size and Color\">
                           <input type=\"hidden\" name=\"os2\" value=\"$sizes $color\">
                           <input type=\"hidden\" name=\"on3\" value=\"Lettering Style\">
                           <input type=\"hidden\" name=\"os3\" value=\"$letstyle\">
                           <input type=\"hidden\" name=\"on4\" value=\"Personalization\">
                           <input type=\"hidden\" name=\"os4\" value=\"$personalization\">
                           <input type=\"hidden\" name=\"on5\" value=\"Design Color\">
                           <input type=\"hidden\" name=\"os5\" value=\"$designcolor\">
                           <input type=\"hidden\" name=\"on6\" value=\"Special Instruction\">
                           <input type=\"hidden\" name=\"os6\" value=\"$special\">
                           <input type=\"image\" src=\"https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif\" border=\"0\" name=\"submit\" alt=\"PayPal - The safer, easier way to pay online!\">
 
</form>
?>

Open in new window

</table>";
<form action=\"https

change  </table>"; for

 <tr><td colspan=3 align=\"right\">

and after </form> add </td></tr></table>";
Still not working for me...

You can see what I'm getting here after you click the next button:

http://www.djmgraphix.com/THE_ART_BUCKET/airbrush_apparel/design1.html

Do I also have to go back and change a few things in the original form?
<?php
 
//Get data from the form submission
$product = $_POST['product'];
$options = $_POST['options'];
$material = $_POST['material'];
$sizes = $_POST['sizes'];
$color = $_POST['color'];
$letstyle = $_POST['letstyle'];
$destination = $_POST['destination'];
$personalization = $_POST['personalization'];
$designcolor = $_POST['designcolor'];
$special = $_POST['special'];
 
//extract the price of the options selected
$price2 = array_filter(explode(' ', $product), 'is_numeric');
$options2 = array_filter(explode(' ', $options), 'is_numeric');
$sizes2 = array_filter(explode(' ', $sizes), 'is_numeric');
 
//shipping charge depending on destination
if($destination == 'AL'){$shipping = "5.00";}
 elseif($destination == 'AK'){$shipping = "5.00";}
  elseif($destination == 'AS'){$shipping = "5.00";}
   elseif($destination == 'AZ'){$shipping = "5.00";}
    elseif($destination == 'AR'){$shipping = "5.00";}
     elseif($destination == 'CA'){$shipping = "5.00";}
      elseif($destination == 'CO'){$shipping = "5.00";}
       elseif($destination == 'CT'){$shipping = "5.00";}
        elseif($destination == 'DE'){$shipping = "5.00";}
         elseif($destination == 'DC'){$shipping = "5.00";}
          elseif($destination == 'FL'){$shipping = "5.00";}
           elseif($destination == 'GA'){$shipping = "5.00";}
            elseif($destination == 'GU'){$shipping = "5.00";}
             elseif($destination == 'HI'){$shipping = "5.00";}
              elseif($destination == 'ID'){$shipping = "5.00";}
               elseif($destination == 'IL'){$shipping = "5.00";}
                elseif($destination == 'IN'){$shipping = "5.00";}
                 elseif($destination == 'IA'){$shipping = "5.00";}
                  elseif($destination == 'KS'){$shipping = "5.00";}
                   elseif($destination == 'KY'){$shipping = "5.00";}
                    elseif($destination == 'LA'){$shipping = "5.00";}
                     elseif($destination == 'ME'){$shipping = "5.00";}
                      elseif($destination == 'MD'){$shipping = "5.00";}
                       elseif($destination == 'MA'){$shipping = "5.00";}
                        elseif($destination == 'MI'){$shipping = "5.00";}
                         elseif($destination == 'MN'){$shipping = "5.00";}
                          elseif($destination == 'MS'){$shipping = "5.00";}
                           elseif($destination == 'MO'){$shipping = "5.00";}
                            elseif($destination == 'MT'){$shipping = "5.00";}
                             elseif($destination == 'NE'){$shipping = "5.00";}
                              elseif($destination == 'NV'){$shipping = "5.00";}
                               elseif($destination == 'NH'){$shipping = "5.00";}
                                elseif($destination == 'NJ'){$shipping = "5.00";}
                                 elseif($destination == 'NM'){$shipping = "5.00";}
                                  elseif($destination == 'NY'){$shipping = "5.00";}
                                   elseif($destination == 'NC'){$shipping = "5.00";}
                                    elseif($destination == 'ND'){$shipping = "5.00";}
                                     elseif($destination == 'OH'){$shipping = "5.00";}
                                      elseif($destination == 'OK'){$shipping = "5.00";}
                                       elseif($destination == 'OR'){$shipping = "5.00";}
                                        elseif($destination == 'PA'){$shipping = "5.00";}
                                         elseif($destination == 'PR'){$shipping = "5.00";}
                                          elseif($destination == 'RI'){$shipping = "5.00";}
                                           elseif($destination == 'SC'){$shipping = "5.00";}
                                            elseif($destination == 'SD'){$shipping = "5.00";}
                                             elseif($destination == 'TN'){$shipping = "5.00";}
                                              elseif($destination == 'TX'){$shipping = "5.00";}
                                               elseif($destination == 'UT'){$shipping = "5.00";}
                                                elseif($destination == 'VT'){$shipping = "5.00";}
                                                 elseif($destination == 'VI'){$shipping = "5.00";}
                                                  elseif($destination == 'VA'){$shipping = "5.00";}
                                                   elseif($destination == 'WA'){$shipping = "5.00";}
                                                    elseif($destination == 'WV'){$shipping = "5.00";}
                                                     elseif($destination == 'WI'){$shipping = "5.00";}
                                                      elseif($destination == 'WY'){$shipping = "5.00";}
 
 
 
 
//assign price to a variable
foreach($price2 as $value1){$pprice = "$value1";}
foreach($options2 as $value2){$poption = "$value2";}
foreach($sizes2 as $value3){$psizes = "$value3";}
 
//use the variables to do the calculation
$subtotal = $pprice + $poption + $psizes;
if($destination == 'NY'){$subtotal = $subtotal * 1.03;}
$subtotal = $subtotal + $shipping;
$total = number_format($subtotal, 2, '.', '');
 
//remove the price from the options (to display in item list)
$illegalchars_type_1 = array("1","2","3","4","5","6","7","8","9","0",".");
$product = str_replace($illegalchars_type_1,"",$product);
$options = str_replace($illegalchars_type_1,"",$options);
$sizes = str_replace($illegalchars_type_1,"",$sizes);
 
//displaying the choice, prices and total
echo "<table border=1 cellpadding=2 cellspacing=0 width=\"450\">
       <tr>
         <th>Product and Options</th>
         <th>Price</th>
       </tr>
       <tr><td>Product</td>              <td>$product</td>                       <td align=\"right\">$pprice</td></tr>
       <tr><td>Options</td>              <td>$options</td>                       <td align=\"right\">$poption</td></tr>
       <tr><td>Material</td>             <td>$material</td>                      <td>&nbsp;</td></tr>
       <tr><td>Size</td>                 <td>$sizes</td>                         <td align=\"right\">$psizes</td></tr>
       <tr><td>Color</td>                <td>$color</td>                         <td>&nbsp;</td></tr>
       <tr><td>Lettering Style</td>      <td>$letstyle</td>                      <td>&nbsp;</td></tr>
       <tr><td>Personalization</td>      <td colspan=2>$personalization</td></tr>
       <tr><td>Design Color</td>         <td colspan=2>$designcolor</td></tr>
       <tr><td>Special Instructions      <td colspan=2>$special</td></tr>
       <tr><td>Shipping to</td>          <td>$destination</td>                   <td align=\"right\">$shipping</td></tr>
       <tr><td>Total</td>                <td colspan=2 align=\"right\">$total</td></tr>
      <tr><td colspan=3 align=\"right\">
	  <form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\" style=\"padding: 0px; margin: 0px\">
                           <input type=\"hidden\" name=\"cmd\" value=\"_xclick\">
                           <input type=\"hidden\" name=\"business\" value=\"EMAIL ADDRESS\">
                           <input type=\"hidden\" name=\"amount\" value=\"$total\">
                           <input type=\"hidden\" name=\"item_name\" value=\"$product\">
                           <input type=\"hidden\" name=\"item_number\" value=\"\">
                           <input type=\"hidden\" name=\"on0\" value=\"Options\">
                           <input type=\"hidden\" name=\"os0\" Value=\"$options\">
                           <input type=\"hidden\" name=\"on1\" value=\"Material\">
                           <input type=\"hidden\" name=\"os1\" value=\"$material\">
                           <input type=\"hidden\" name=\"on2\" value=\"Size and Color\">
                           <input type=\"hidden\" name=\"os2\" value=\"$sizes $color\">
                           <input type=\"hidden\" name=\"on3\" value=\"Lettering Style\">
                           <input type=\"hidden\" name=\"os3\" value=\"$letstyle\">
                           <input type=\"hidden\" name=\"on4\" value=\"Personalization\">
                           <input type=\"hidden\" name=\"os4\" value=\"$personalization\">
                           <input type=\"hidden\" name=\"on5\" value=\"Design Color\">
                           <input type=\"hidden\" name=\"os5\" value=\"$designcolor\">
                           <input type=\"hidden\" name=\"on6\" value=\"Special Instruction\">
                           <input type=\"hidden\" name=\"os6\" value=\"$special\">
                           <input type=\"image\" src=\"https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif\" border=\"0\" name=\"submit\" alt=\"PayPal - The safer, easier way to pay online!\">
 
</form></td></tr></table>";
 
?>

Open in new window

I would need the file to find out what is going on, the error said on line 190, the one you are showing goes to 139 and on a side note the whole script you showed do not trigger an error.

I'm sure it is minor but cannot find it without the whole page. If you do not want to post it here you can find my email address in my profile.
This is what my line 190 is...

I can still send you the file if you want...
       <tr><td>Shipping to</td>          <td>$destination</td>                   <td align=\"right\">$shipping</td>

Open in new window

Can you send me the file, I do not see anything wrong with the line, but the problem could be before that line.
sure... I just tried emailing it to you but it was returned...

Says it didn't meet POLICY reasons?

It was a DW file...

 host mx1.hotmail.com [65.55.92.136]: 550 OU-001 Mail rejected by Windows Live Hotmail for policy reasons. Reasons for rejection may be related to content with spam-like characteristics or IP/domain reputation problems. If you are not an email/network admin please contact your E-mail/Internet Service Provider for help. Email/network admins, please visit http://postmaster.live.com for email delivery information and support


Lines 185 - 195:


      <tr><td>Color</td>                <td>$color</td>                         <td>&nbsp;</td></tr>
       <tr><td>Lettering Style</td>      <td>$letstyle</td>                      <td>&nbsp;</td></tr>
       <tr><td>Personalization</td>      <td colspan=2>$personalization</td></tr>
       <tr><td>Design Color</td>         <td colspan=2>$designcolor</td></tr>
       <tr><td>Special Instructions      <td colspan=2>$special</td></tr>
       <tr><td>Shipping to</td>          <td>$destination</td>                   <td align=\"right\">$shipping</td></tr>
       <tr><td>Total</td>                <td colspan=2 align=\"right\">$total</td></tr>
      <tr><td colspan=3 align=\"right\">
	  <form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\" style=\"padding: 0px; margin: 0px\">
                           <input type=\"hidden\" name=\"cmd\" value=\"_xclick\">
                           <input type=\"hidden\" name=\"business\" value=\"EMAIL ADDRESS\">

Open in new window

Heres the page as of right now:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>&quot; THE ART BUCKET &quot; - Airbrush Apparel</title>
<style type="text/css">
<!--
body {
	background-color: #be1eb6;
	background-image: url(../background2.jpg);
	background-repeat: repeat-x;
}
body,td,th {
	font-family: Arial, Helvetica, sans-serif;
}
.style33 {
	color: #9900FF
}
-->
</style>
<script src="../Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<!-- Copyright 2000, 2001, 2002, 2003 Macromedia, Inc. All rights reserved. -->
<!-- Copyright 2000-2006 Adobe Macromedia Software LLC and its licensors. All rights reserved. -->
<!-- Copyright 2000-2006 Adobe Macromedia Software LLC and its licensors. All rights reserved. -->
</head>
 
<body>
<div align="center">
  <table width="750" border="0" cellpadding="0" cellspacing="0">
    <!--DWLayoutTable-->
    <tr>
      <td width="750" height="13"></td>
    </tr>
    <tr>
      <td height="300" valign="top"><script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','750','height','300','src','../swf_files/bannor_airbrush','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','../swf_files/bannor_airbrush' ); //end AC code
</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="750" height="300">
        <param name="movie" value="../swf_files/bannor_airbrush.swf" />
        <param name="quality" value="high" />
        <embed src="../swf_files/bannor_airbrush.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="750" height="300"></embed>
      </object></noscript></td>
    </tr>
    <tr>
      <td height="38">&nbsp;</td>
    </tr>
    <tr>
      <td height="1298" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"background="../background1.jpg">
        <!--DWLayoutTable-->
        <tr>
          <td height="30" colspan="7" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
          </tr>
        <tr>
          <td width="35" rowspan="5" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
            <td height="90" colspan="5" valign="top"><script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','680','height','90','src','../swf_files/buttons','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','../swf_files/buttons' ); //end AC code
</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="680" height="90">
              <param name="movie" value="../swf_files/buttons.swf" />
              <param name="quality" value="high" />
              <embed src="../swf_files/buttons.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="680" height="90"></embed>
            </object></noscript></td>
            <td width="32">&nbsp;</td>
        </tr>
        <tr>
          <td height="18" colspan="5" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
          <td></td>
        </tr>
        <tr>
          <td width="13" height="109">&nbsp;</td>
          <td colspan="3" valign="top"><div align="justify"><span class="style33">Please take a moment to look over your order. When your confident that you have ordered everything to your specifications, please click on the, &quot;BUY NOW&quot; button.</span></div></td>
          <td width="15">&nbsp;</td>
          <td></td>
        </tr>
        <tr>
          <td height="336">&nbsp;</td>
          <td width="102">&nbsp;</td>
          <td width="471" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
            <!--DWLayoutTable-->
            <tr>
              <td width="471" height="336" valign="top"><?php
 
//Get data from the form submission
$product = $_POST['product'];
$options = $_POST['options'];
$material = $_POST['material'];
$sizes = $_POST['sizes'];
$color = $_POST['color'];
$letstyle = $_POST['letstyle'];
$destination = $_POST['destination'];
$personalization = $_POST['personalization'];
$designcolor = $_POST['designcolor'];
$special = $_POST['special'];
 
//extract the price of the options selected
$price2 = array_filter(explode(' ', $product), 'is_numeric');
$options2 = array_filter(explode(' ', $options), 'is_numeric');
$sizes2 = array_filter(explode(' ', $sizes), 'is_numeric');
 
//shipping charge depending on destination
if($destination == 'AL'){$shipping = "5.00";}
 elseif($destination == 'AK'){$shipping = "5.00";}
  elseif($destination == 'AS'){$shipping = "5.00";}
   elseif($destination == 'AZ'){$shipping = "5.00";}
    elseif($destination == 'AR'){$shipping = "5.00";}
     elseif($destination == 'CA'){$shipping = "5.00";}
      elseif($destination == 'CO'){$shipping = "5.00";}
       elseif($destination == 'CT'){$shipping = "5.00";}
        elseif($destination == 'DE'){$shipping = "5.00";}
         elseif($destination == 'DC'){$shipping = "5.00";}
          elseif($destination == 'FL'){$shipping = "5.00";}
           elseif($destination == 'GA'){$shipping = "5.00";}
            elseif($destination == 'GU'){$shipping = "5.00";}
             elseif($destination == 'HI'){$shipping = "5.00";}
              elseif($destination == 'ID'){$shipping = "5.00";}
               elseif($destination == 'IL'){$shipping = "5.00";}
                elseif($destination == 'IN'){$shipping = "5.00";}
                 elseif($destination == 'IA'){$shipping = "5.00";}
                  elseif($destination == 'KS'){$shipping = "5.00";}
                   elseif($destination == 'KY'){$shipping = "5.00";}
                    elseif($destination == 'LA'){$shipping = "5.00";}
                     elseif($destination == 'ME'){$shipping = "5.00";}
                      elseif($destination == 'MD'){$shipping = "5.00";}
                       elseif($destination == 'MA'){$shipping = "5.00";}
                        elseif($destination == 'MI'){$shipping = "5.00";}
                         elseif($destination == 'MN'){$shipping = "5.00";}
                          elseif($destination == 'MS'){$shipping = "5.00";}
                           elseif($destination == 'MO'){$shipping = "5.00";}
                            elseif($destination == 'MT'){$shipping = "5.00";}
                             elseif($destination == 'NE'){$shipping = "5.00";}
                              elseif($destination == 'NV'){$shipping = "5.00";}
                               elseif($destination == 'NH'){$shipping = "5.00";}
                                elseif($destination == 'NJ'){$shipping = "5.00";}
                                 elseif($destination == 'NM'){$shipping = "5.00";}
                                  elseif($destination == 'NY'){$shipping = "5.00";}
                                   elseif($destination == 'NC'){$shipping = "5.00";}
                                    elseif($destination == 'ND'){$shipping = "5.00";}
                                     elseif($destination == 'OH'){$shipping = "5.00";}
                                      elseif($destination == 'OK'){$shipping = "5.00";}
                                       elseif($destination == 'OR'){$shipping = "5.00";}
                                        elseif($destination == 'PA'){$shipping = "5.00";}
                                         elseif($destination == 'PR'){$shipping = "5.00";}
                                          elseif($destination == 'RI'){$shipping = "5.00";}
                                           elseif($destination == 'SC'){$shipping = "5.00";}
                                            elseif($destination == 'SD'){$shipping = "5.00";}
                                             elseif($destination == 'TN'){$shipping = "5.00";}
                                              elseif($destination == 'TX'){$shipping = "5.00";}
                                               elseif($destination == 'UT'){$shipping = "5.00";}
                                                elseif($destination == 'VT'){$shipping = "5.00";}
                                                 elseif($destination == 'VI'){$shipping = "5.00";}
                                                  elseif($destination == 'VA'){$shipping = "5.00";}
                                                   elseif($destination == 'WA'){$shipping = "5.00";}
                                                    elseif($destination == 'WV'){$shipping = "5.00";}
                                                     elseif($destination == 'WI'){$shipping = "5.00";}
                                                      elseif($destination == 'WY'){$shipping = "5.00";}
 
 
 
 
//assign price to a variable
foreach($price2 as $value1){$pprice = "$value1";}
foreach($options2 as $value2){$poption = "$value2";}
foreach($sizes2 as $value3){$psizes = "$value3";}
 
//use the variables to do the calculation
$subtotal = $pprice + $poption + $psizes;
if($destination == 'NY'){$subtotal = $subtotal * 1.03;}
$subtotal = $subtotal + $shipping;
$total = number_format($subtotal, 2, '.', '');
 
//remove the price from the options (to display in item list)
$illegalchars_type_1 = array("1","2","3","4","5","6","7","8","9","0",".");
$product = str_replace($illegalchars_type_1,"",$product);
$options = str_replace($illegalchars_type_1,"",$options);
$sizes = str_replace($illegalchars_type_1,"",$sizes);
 
//displaying the choice, prices and total
echo "<table border=1 cellpadding=2 cellspacing=0 width=\"450\">
       <tr>
         <th>Product and Options</th>
         <th>Price</th>
       </tr>
       <tr><td>Product</td>              <td>$product</td>                       <td align=\"right\">$pprice</td></tr>
       <tr><td>Options</td>              <td>$options</td>                       <td align=\"right\">$poption</td></tr>
       <tr><td>Material</td>             <td>$material</td>                      <td>&nbsp;</td></tr>
       <tr><td>Size</td>                 <td>$sizes</td>                         <td align=\"right\">$psizes</td></tr>
       <tr><td>Color</td>                <td>$color</td>                         <td>&nbsp;</td></tr>
       <tr><td>Lettering Style</td>      <td>$letstyle</td>                      <td>&nbsp;</td></tr>
       <tr><td>Personalization</td>      <td colspan=2>$personalization</td></tr>
       <tr><td>Design Color</td>         <td colspan=2>$designcolor</td></tr>
       <tr><td>Special Instructions      <td colspan=2>$special</td></tr>
       <tr><td>Shipping to</td>          <td>$destination</td>                   <td align=\"right\">$shipping</td></tr>
       <tr><td>Total</td>                <td colspan=2 align=\"right\">$total</td></tr>
      <tr><td colspan=3 align=\"right\">
	  <form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\" style=\"padding: 0px; margin: 0px\">
                           <input type=\"hidden\" name=\"cmd\" value=\"_xclick\">
                           <input type=\"hidden\" name=\"business\" value=\"EMAIL ADDRESS\">
                           <input type=\"hidden\" name=\"amount\" value=\"$total\">
                           <input type=\"hidden\" name=\"item_name\" value=\"$product\">
                           <input type=\"hidden\" name=\"item_number\" value=\"\">
                           <input type=\"hidden\" name=\"on0\" value=\"Options\">
                           <input type=\"hidden\" name=\"os0\" Value=\"$options\">
                           <input type=\"hidden\" name=\"on1\" value=\"Material\">
                           <input type=\"hidden\" name=\"os1\" value=\"$material\">
                           <input type=\"hidden\" name=\"on2\" value=\"Size and Color\">
                           <input type=\"hidden\" name=\"os2\" value=\"$sizes $color\">
                           <input type=\"hidden\" name=\"on3\" value=\"Lettering Style\">
                           <input type=\"hidden\" name=\"os3\" value=\"$letstyle\">
                           <input type=\"hidden\" name=\"on4\" value=\"Personalization\">
                           <input type=\"hidden\" name=\"os4\" value=\"$personalization\">
                           <input type=\"hidden\" name=\"on5\" value=\"Design Color\">
                           <input type=\"hidden\" name=\"os5\" value=\"$designcolor\">
                           <input type=\"hidden\" name=\"on6\" value=\"Special Instruction\">
                           <input type=\"hidden\" name=\"os6\" value=\"$special\">
                           <input type=\"image\" src=\"https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif\" border=\"0\" name=\"submit\" alt=\"PayPal - The safer, easier way to pay online!\">
 
</form></td></tr></table>";
 
?></td>
            </tr>
          </table>
          </td>
          <td width="82">&nbsp;</td>
          <td>&nbsp;</td>
            <td>&nbsp;</td>
        </tr>
        <tr>
          <td height="731">&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        
        
        
        
        
        
        
        
      </table></td>
    </tr>
  </table>
</div>
</body>
</html>

Open in new window

Ok this is frustrating

unexpected '<' in /home/djmgraph...

means we are in php mode and we did not use echo or print prior of using < and I cannot see where it is coming from.
I'll BRB in 20min...  I'll try just having the page only with the PHP and none of the HTML... see if that works.

Thanks,
I'll be back
I cannot reproduce the behavior on my server, I suggest you upload the file again to your server (the same one you showed me)

http://www.cemond.com/EE/orderprocess.php
I uploaded it again...

If there is nothing wrong with the orderprocess.php page... i must have something wrong with the form sending the information to it?

I haven't updated that since yesterday...  I'm assuming you  have made a few changes...
I'll try that..


BINGO!

Whatever it did... it worked...   So I think all I have to change now is the email...
Awesome... So I'll be adding this form to each of the DESIN # pages... where can I add in the HIDDEN line that denotes the DESIGN # so I can see it after the order is done...

I can change that line on each form...
ASKER CERTIFIED SOLUTION
Avatar of gamebits
gamebits
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I'm guessing that the :  value="1234">  I  change to the number of the design...

and on the paypal process page... should it look like this?

or do I also have to add the line: $designnumber = $_POST['designnumber'];
Because I changed the 5th line down on the <input type=



<form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\" style=\"padding: 0px; margin: 0px\">
                           <input type=\"hidden\" name=\"cmd\" value=\"_xclick\">
                           <input type=\"hidden\" name=\"business\" value=\"amanda@theartbucket.com\">
                           <input type=\"hidden\" name=\"amount\" value=\"$total\">
                           <input type=\"hidden\" name=\"item_name\" value=\"$product\">
                           <input type=\"hidden\" name=\"item_number\" value=\"$designnumber\">
                           <input type=\"hidden\" name=\"on0\" value=\"Options\">
                           <input type=\"hidden\" name=\"os0\" Value=\"$options\">
                           <input type=\"hidden\" name=\"on1\" value=\"Material\">
                           <input type=\"hidden\" name=\"os1\" value=\"$material\">
                           <input type=\"hidden\" name=\"on2\" value=\"Size and Color\">
                           <input type=\"hidden\" name=\"os2\" value=\"$sizes $color\">
                           <input type=\"hidden\" name=\"on3\" value=\"Lettering Style\">
                           <input type=\"hidden\" name=\"os3\" value=\"$letstyle\">
                           <input type=\"hidden\" name=\"on4\" value=\"Personalization\">
                           <input type=\"hidden\" name=\"os4\" value=\"$personalization\">
                           <input type=\"hidden\" name=\"on5\" value=\"Design Color\">
                           <input type=\"hidden\" name=\"os5\" value=\"$designcolor\">
                           <input type=\"hidden\" name=\"on6\" value=\"Special Instruction\">
                           <input type=\"hidden\" name=\"os6\" value=\"$special\">
                           <input type=\"image\" src=\"https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif\" border=\"0\" name=\"submit\" alt=\"PayPal - The safer, easier way to pay online!\">
add it to the list

//Get data from the form submission
$product = $_POST['product'];
$options = $_POST['options'];
$material = $_POST['material'];
$sizes = $_POST['sizes'];
$color = $_POST['color'];
$letstyle = $_POST['letstyle'];
$destination = $_POST['destination'];
$personalization = $_POST['personalization'];
$designcolor = $_POST['designcolor'];
$special = $_POST['special'];
$designnumber = $_POST['designnumber'];
 

You already added it to the Paypal form and yes you replace 1234 by the design number you want to use.
Awesome! Done!

I can't thank you enough! ... I'm going to ask another question so I can award separate points...  It will relate to this form... u just created for me...  So you might have the upper hand:)

Thanks again!
Glad to help.
The most dedicated EXPERTS i have seen on here...  Thank you so much...

This guy knows his PHP!
Hey,

The question I want to ask on EE is if it is possible for IF for example the CAN KOOZIE or WRIST BAND is selected... to black out some of the dropdowns so they can't be selected because they have nothing to do with that product...

IF it's possible... I'll definitely ask that question!

Give you all the points in the world man.

THanks,
DJM

It is possible but this will use javascript with an onchange trigger, I would suggest you ask the question in the Javascript area I may or may not come up with a script but I know there is some guys here waaaaayyyy better than me with Javascript.
Hey Brother,

I was finally given the options for the form you created the other day for me! :) ... I would love to get your take on this one...  

I posted it on the Javascript page... and someone KINDA started it for me... however what they have done is a starter...  did the first 3 product options... didn't do them accurately.. and when you hit the next button.. the totals are lost.

Here is what they started....

http://www.djmgraphix.com/THE_ART_BUCKET/airbrush_apparel/test.html


Here's what my post said:  https://www.experts-exchange.com/questions/24537412/Javascript-Help-Dropdown-Form-possible-php.html


http://www.djmgraphix.com/THE_ART_BUCKET/airbrush_apparel/design1.html

When you click on the NEXT button it goes to a PHP total page and then sends all of the information to paypal.

The reason it was so hard, is because paypal is a pain in the butt when it comes to submitting more than one total, or have products or services that you have to add up.

ANYWAYS... I would like to edit the form so when products are chosen from the, "PRODUCT OPTIONS" dropdown, the dropdowns underneath it change to fit the options there are available (colors, sizes etc....)  I've typed this up so you can see the options I'm looking for.

THANK YOU SO MUCH TO ANYONE WHO CAN HELP ME!

DJM





Product Options:
      Baby Onesies ($18.00)
      Baby Long-Sleeve ($18.00)
      Baby Bib ($10.00)
      Baby Short-Sleeve ($15.00)
      Youth Short-Sleeve (20.00)
      Mens Short-Sleeve ($20.00)
      Mens Long-Sleeve ($23.00)
      Mens Tank-Top ($22.00)
      Zip-Up Hoodie ($38.00)
      Hoodie ($32.00)
      Womens Short-Sleeve ($20.00)
      Womens Tank-Top ($22.00)
      Womens Long-Sleeve ($25.00)
      Womens Cheer Shorts ($22.00)
      Tote Bag ($20.00)
      Gym Bag ($25.00)
      Trucker Hat ($18.00)
      Can Koozie ($8.00)

The Following are the Dropdowns that I want to HIGHLIGHT or APPEAR if APPLICABLE TO THE PRODUCT Selected:

LETTERING STYLE, PLEASE SELECT DESTINATION, NAME FOR PERSONALIZATION, DESIGN COLORS YOU WANT TO SEE, and SPECIAL INSTRUCTIONS FOR THE ARTIST, will be included no matter what the product choice after the SIZES dropdown.


Baby Onesies ($18.00)
      Design Options:
            Design and Name on Front
            Design and Name on Back
            Design on Front and Name on Back (+$6.00)
            Design on Back and Name on Front (+$6.00)
      Colors:
            White
            Black
      Sizes:
            0-3 Months
            3-6 Months
            6-12 Months
            12-18 Months

Baby Long-Sleeve ($18.00)
      Design Options:
            Design and Name on Front
            Design and Name on Back
            Design on Front and Name on Back (+$6.00)
            Design on Back and Name on Front (+$6.00)
      Colors:
            White
            Black
            Lavender
            Baby Blue
      Sizes:
            0-3 Months
            3-6 Months
            6-12 Months
            12-18 Months

Baby Bib ($10.00)
      Colors:
            White
            Black
      Sizes:
            One Size

Baby Hat($10.00)
      Colors:
            White
            Black
      Sizes:
            One Size

Baby Short-Sleeve ($15.00)
      Design Options:
            Design and Name on Front
            Design and Name on Back
            Design on Front and Name on Back (+$6.00)
            Design on Back and Name on Front (+$6.00)
      Colors:
            White
      Sizes:
            12 Months
            18 Months
            2T

Youth Short-Sleeve (20.00)
      Design Options:
            Design and Name on Front
            Design and Name on Back
            Design on Front and Name on Back (+$6.00)
            Design on Back and Name on Front (+$6.00)
      Colors:
            White
      Sizes:
            XS
            Small
            Medium
            Large
            XL

Mens Short-Sleeve ($20.00)
      Design Options:
            Design and Name on Front
            Design and Name on Back
            Design on Front and Name on Back (+$6.00)
            Design on Back and Name on Front (+$6.00)
      Colors:
            White
            Black (+$10.00)
      Sizes:
            Small
            Medium
            Large
            XL
            2X (+$3.00)
            3X (+$3.00)

Mens Long-Sleeve ($23.00)
      Design Options:
            Design and Name on Front
            Design and Name on Back
            Design on Front and Name on Back (+$6.00)
            Design on Back and Name on Front (+$6.00)
      Colors:
            White
            Black (+$10.00)
      Sizes:
            Small
            Medium
            Large
            XL
            2X (+$3.00)
            3X (+$3.00)

Mens Tank-Top ($22.00)
      Design Options:
            Design and Name on Front
            Design and Name on Back
            Design on Front and Name on Back (+$6.00)
            Design on Back and Name on Front (+$6.00)
Colors:
            White
      Sizes:
            Small
            Medium
            Large
            XL

Zip-Up Hoodie ($38.00)
      Design Options:
            Design and Name on Front
            Design and Name on Back
            Design on Front and Name on Back (+$6.00)
            Design on Back and Name on Front (+$6.00)
      Colors:
            White
            Black (+$10.00)
      Sizes:
            Small
            Medium
            Large
            XL
            2X (+$3.00)
            3X (+$3.00)

Hoodie ($32.00)
            Design Options:
            Design and Name on Front
            Design and Name on Back
            Design on Front and Name on Back (+$6.00)
            Design on Back and Name on Front (+$6.00)
      Colors:
            White
            Black (+$10.00)
      Sizes:
            Small
            Medium
            Large
            XL
            2X (+$3.00)
            3X (+$3.00)

Womens Short-Sleeve ($22.00)
      Design Options:
            Design and Name on Front
            Design and Name on Back
            Design on Front and Name on Back (+$6.00)
            Design on Back and Name on Front (+$6.00)
Colors:
            White
      Sizes:
            Small
            Medium
            Large

Womens Tank-Top ($22.00)
      Design Options:
            Design and Name on Front
            Design and Name on Back
            Design on Front and Name on Back (+$6.00)
            Design on Back and Name on Front (+$6.00)
Colors:
            White
      Sizes:
            Small
            Medium
            Large
            XL

Womens Long-Sleeve ($25.00)
      Design Options:
            Design and Name on Front
            Design and Name on Back
            Design on Front and Name on Back (+$6.00)
            Design on Back and Name on Front (+$6.00)
      Colors:
            White
            Black (+$10.00)
      Sizes:
            Small
            Medium
            Large
     
Womens Cheer Shorts ($22.00)
      Design Options:
            Design and Name on Front
            Design and Name on Back
            Design on Front and Name on Back (+$6.00)
            Design on Back and Name on Front (+$6.00)
      Colors:
            Grey
      Sizes:
            XS
Small
            Medium
            Large
            XL

Tote Bag ($20.00)
      Design Options:
            Design and Name on Front
            Design and Name on Back
            Design on Front and Name on Back (+$6.00)
            Design on Back and Name on Front (+$6.00)
      Colors:
            White
            Natural
      Sizes:
            One Size

Gym Bag ($25.00)
      Design Options:
            Design and Name on Front
            Design and Name on Back
            Design on Front and Name on Back (+$6.00)
            Design on Back and Name on Front (+$6.00)
Colors:
            White
      Sizes:
            One Size

Trucker Hat ($18.00)
      Design Options:
            Design and Name on Front
Colors:
            White
            Blue/White
            Pink/White
            Black/White
      Sizes:
            One Size

Can Koozie ($8.00)
      Design Options:
            Design and Name on Front
Colors:
            White
      Sizes:
            One Size

Javascript is not exactly my forte and there is a lot of work to match all the categories and subcategories but what concern me the most is I don't think it is the proper way to go, you need something more flexible, for instance you should have different tables for the categories and establish the relation between the categories in those tables, than you can build the dropdown by querying the database, biggest advantage by doing that is if something changes item added or removed price change etc. you do not have to rewrite the code.
Yeah... I had a feeling that this wasn't the best way to go about it.

I know nothing about databases... and querying them.  :)

I think that the guy helping me with the JS was kinda on the right track for an immediate answer... It just worried me with that small test that they weren't being totaled...
Did you change anything on the form we made together? Especially form element name.

Because if you look at the test page he provided you will see that the name have been changed.

<p>Design Options:                
      <select name="onesies_options">  

instead of

<p>Design Options:                
      <select name="options">  

your script is expecting "options" not "onesies_options" that would explain why it is not totaling
The only thing I CHANGED... was adding in the BABY HAT.. and the MENS TANK...    I cant figure out why there were spaces after them in the dropdown after I added them.
For a broke Graphic designer trying to figure out JS and PHP.. It's killing me... I know that you have an idea on how long I've been trying to get this form right...

Can I send you like $25 via paypal if you can get this form the way I need it?

The woman I'm doing this for said that there will be no product changes in the near future... if so.. that's extra charge on her...


I'm not here for the money but in the future I may ask for a discount on good graphics :)

Few question do you have access to a database on your server (MySQL)?
If so would you be interested to include a database in your script?

Either way I need some times to get my head around it and come up with something, let me know.
Oh, by the way I was right about the name changed you can try it here

http://www.cemond.com/EE/testpay.php
"I cant figure out why there were spaces after them in the dropdown after I added them."

<option value="Youth Short-Sleeve 25.00">Youth Short-Sleeve (25.00)<option> <<because you did not close the tag, you are missing the forward slash /, should be </option)
</option>
I'm not sure about her server... It's going to go on HER godaddy server when I'm all done with the site...

So I don't know how to answer the (MySQL) question.  

At this point... WHATEVER IS EASIEST FOR YOU!  I'm not too worried about editing in the future...  She can deal with that later... she's assured me that this will stay the same for a decent amount of time to see how it goes...  If you decide to help me out.... be sure to put it on the other question so I can give you those points too :)
Ok, give me some time next post will be on the other question.
Note that the other guy had some of the info wrong...  with sizes and colors.. he only did the 3 and there were mistakes :)
I finished the changes to the script, if you want to try it the link is on the other question.