Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hello, I am new to PHP and I am trying to develop a function that will gain an estimate for vistors through a form, I have the form all worked out, and I have written the PHP code to process it. When I went to test it out, I got this error messege:Code: Select all
Parse error: parse error, unexpected T_IFCode: Select all
if ($quantity2 < "3000"){
$reloadprice = 0;}
if ($quantity2 > "3000"){
if ($printsides == "one"){
$reloadprice = $quantity2 / 3000 * 20;}}
if ($quantity2 > "3000"){
if ($printsides == "two"){
$reloadprice = $quantity2 / 3000 * 40;}}
if ($quantity2 <= "6000"){
$impressionprice = 0;}
if ($quantity2 > "6000"){
if ($printsides == "one"){
$impressionprice = $quantity2 / 6000 * 60;}}
if ($quantity2 > "6000"){
if ($printsides = "two"){
$impressionprice = $quantity2 / 6000 * 120;}}
$price1 + $price2 + $impressionprice + $reloadprice = $total;
echo $total;Can anyone here help me out? As I said I am new to PHP and I would apprieciate any help at all
the full code is as follows
Code: Select all
<?php
//set varibles from form
$colorchoice = $_POST['colorchoice'];
$design = $_POST['design'];
$printsides = $_POST['printsides'];
$quantity = $_POST['quantity'];
$paper = $_POST['paper'];
$closereg = $_POST['closereg'];
//set color info from form
//deal with those checkboxes
foreach($_POST['colors'] as $value) {
$f .= $value;
}
//begin estimate process
//get color price
if ($colorchoice == "one"){
$colorprice = 60;}
if ($colorchoice == "two"){
$colorprice = 120;}
if ($colorchoice == "three"){
$colorprice = 180;}
//get close registration price
if ($closereg == "two"){
$closeregprice = 0;}
if ($closereg == "one"){
if ($colorchoice == "one"){
$closeregprice = 0;}}
if ($closereg == "one"){
if ($colorchoice == "two"){
$closeregprice = 30;}}
if ($closereg == "one"){
if ($colorchoice == "three"){
$closeregprice = 60;}}
//get printsides
if ($printsides == "one"){
$printsides2 = 1;}
if ($printsides == "two"){
$printsides2 = 2;}
//get quantity
$quantity == $quantity2;
if ($quantity < "100"){
$quantity2 = 100;}
//get paper price
//8 and 1/2 x 11
if ($paper == "one"){
$paperprice = .01;}
if ($paper == "two"){
$paperprice = .02;}
if ($paper == "three"){
$paperprice = .04;}
if ($paper == "four"){
$paperprice = .03;}
if ($paper == "five"){
$paperprice = .07;}
if ($paper == "six"){
$paperprice = .03;}
if ($paper == "seven"){
$paperprice = .03;}
if ($paper == "eight"){
$paperprice = .08;}
if ($paper == "nine"){
$paperprice = .04;}
if ($paper == "ten"){
$paperprice = .05;}
if ($paper == "oneone"){
$paperprice = .10;}
if ($paper == "onetwo"){
$paperprice == .11;}
if ($paper == "onethree"){
$paperprice = .05;}
if ($paper == "onefour"){
$paperprice = .06;}
//8 and 1/2 by 14 (legal size)
if ($paper == "onefive"){
$paperprice = .01;}
if ($paper == "onesix"){
$paperprice = .03;}
if ($paper == "oneseven"){
$paperprice = .05;}
if ($paper == "oneeight"){
$paperprice = .045;}
if ($paper == "onenine"){
$paperprice = .04;}
//11 x 17 (ledger)
if ($paper == "twofour"){
$paperprice = .02;}
if ($paper == "twofive"){
$paperprice = .04;}
if ($paper == "twosix"){
$paperprice = .06;}
if ($paper == "twoseven"){
$paperprice = .06;}
if ($paper == "twoeight"){
$paperprice = .13;}
if ($paper == "twonine"){
$paperprice = .05;}
if ($paper == "threezero"){
$paperprice = .07;}
if ($paper == "threeone"){
$paperprice = .14;}
if ($paper == "threetwo"){
$paperprice = .14;}
if ($paper == "threethree"){
$paperprice = .10;}
if ($paper == "threefour"){
$paperprice = .20;}
if ($paper == "threefive"){
$paperprice = .25;}
if ($paper == "threesix"){
$paperprice = .10;}
if ($paper == "threeseven"){
$paperprice = .09;}
//begin get total price
$colorprice + $closeregprice = $price1;
$quantity2 * $paperprice = $price2
if ($quantity2 < "3000"){
$reloadprice = 0;}
if ($quantity2 > "3000"){
if ($printsides == "one"){
$reloadprice = $quantity2 / 3000 * 20;}}
if ($quantity2 > "3000"){
if ($printsides == "two"){
$reloadprice = $quantity2 / 3000 * 40;}}
if ($quantity2 <= "6000"){
$impressionprice = 0;}
if ($quantity2 > "6000"){
if ($printsides == "one"){
$impressionprice = $quantity2 / 6000 * 60;}}
if ($quantity2 > "6000"){
if ($printsides = "two"){
$impressionprice = $quantity2 / 6000 * 120;}}
$price1 + $price2 + $impressionprice + $reloadprice = $total;
echo $total;
?>feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]