Ok, here's the code. There's a lot of it, but it's mostly the same statments over & over. I'm not posting the main form page yet, it is huge.
Here is my first handler page, it just sets the cookies.
Code: Select all
<?php
if ( isset($buy) )
{
header("Location: confirm_buy.php");
}
else
{
Setcookie(chassis, $f_chassis, time() + 36000);
Setcookie(proc, $f_proc, time() + 36000);
Setcookie(ram, $f_ram, time() + 36000);
Setcookie(hd1, $f_hd1, time() + 36000);
Setcookie(hd2, $f_hd2, time() + 36000);
Setcookie(cd1, $f_cd1, time() + 36000);
Setcookie(cd2, $f_cd2, time() + 36000);
Setcookie(floppy1, $f_floppy1, time() + 36000);
Setcookie(floppy2, $f_floppy2, time() + 36000);
Setcookie(modem, $f_modem, time() + 36000);
Setcookie(nic, $f_nic, time() + 36000);
Setcookie(video, $f_video, time() + 36000);
Setcookie(monitor, $f_monitor, time() + 36000);
Setcookie(speakers, $f_speakers, time() + 36000);
Setcookie(os, $f_os, time() + 36000);
Setcookie(soft1, $f_soft1, time() + 36000);
Setcookie(soft2, $f_soft2, time() + 36000);
Setcookie(keyboard, $f_keyboard, time() + 36000);
Setcookie(type, $f_type, time() + 36000);
Setcookie(type2, $f_type2, time() + 36000);
header("Location: price_cookie.php");
}
?>
That forwards to this next page, where the prices are set and a total is figured using switch statements. Like I said, I get the correct total - but the cookie is gone when it gets back to the form. It's only happening with the first 4 or so cookies. Here's the second handler.
Code: Select all
<?php
$p_chenbro = 45;
$p_foxconn_black = 40;
$p_ahanix = 45 + 29;
$p_fongkai = 80;
$p_lianli_regular = 108 + 29;
$p_lianli_black = 113 + 29;
$p_chftch = 70;
$p_chftch_window = 99;
$p_duron = 48;
$p_1600 = 68;
$p_1800 = 84;
$p_1900 = 108;
$p_2000 = 128;
$p_2100 = 157;
$p_2200 = 210;
$p_20 = 70;
$p_40 = 72;
$p_60 = 80;
$p_80 = 89;
$p_120 = 140;
$p_128DDR = 41;
$p_256DDR = 66;
$p_512DDR = (2 * $p_256DDR);
$p_256DDR333 = 73;
$p_512DDR333 = (2 * $p_512DDR);
$p_cd = 24;
$p_cd_black = 32;
$p_cdr = 64;
$p_cdr_black = 67;
$p_dvd = 41;
$p_dvd_black = 48;
$p_combo = 85;
$p_combo_black = 169;
$p_dvdrw = 299;
$p_modem = 11;
$p_nic = 6;
$p_floppy = 8;
$p_floppy_black = 11;
$p_zip = 67;
$p_keyboard = 19;
$p_keyboard_black = 18;
$p_keyboard_wireless = 45;
$p_keyboard_wireless_black = 79;
$p_mon17 = 129;
$p_mon17_black = 145;
$p_mon17flat = 142;
$p_mon17flat_black = 180;
$p_mon19flat = 285;
$p_mon19flat_black = 305;
$p_mon22flat = 600;
$p_mon22flat_black = 610;
$p_benwin2pc = 5;
$p_cyber2pc = 6;
$p_creative3pc = 36;
$p_logitech3pc = 36;
$p_logitech5pc = 136;
$p_klipsch6pc = 368;
$p_winxphome = 90;
$p_winxppro = 139;
$p_win2k = 140;
$p_norton = 15;
$p_works = 30;
$p_officexp = 179;
$p_ati7500 = 51;
$p_ati8500 = 110;
$p_gf4ti4200 = 141;
$p_gf4ti4400 = 258;
$p_gf4ti4600 = 299;
$p_extras = 83;
$p_total = 0;
switch ( $_COOKIEї'chassis'] )
{
case ("chenbro"):
{
$p_total += $p_chenbro;
break;
}
case ("foxconn_black"):
{
$p_total += $p_foxconn_black;
break;
}
case ("ahanix"):
{
$p_total += $p_ahanix;
break;
}
case ("fongkai"):
{
$p_total += $p_fongkai;
break;
}
case ("lianli_regular"):
{
$p_total += $p_lianli_regular;
break;
}
case ("lianli_black"):
{
$p_total += $p_lianli_black;
break;
}
case ("chftch"):
{
$p_total += $p_chftch;
break;
}
case ("chftch_window"):
{
$p_total += $p_chftch_window;
break;
}
}
switch ( $_COOKIEї'$proc'] )
{
case ("duron"):
{
$p_total += $p_duron;
break;
}
case ("1600"):
{
$p_total += $p_1600;
break;
}
case ("1800"):
{
$p_total += $p_1800;
break;
}
case ("1900"):
{
$p_total += $p_1900;
break;
}
case ("2000"):
{
$p_total += $p_2000;
break;
}
case ("2100"):
{
$p_total += $p_2100;
break;
}
case ("2200"):
{
$p_total += $p_2200;
break;
}
}
switch ( $_COOKIEї'hd1'] )
{
case ("20"):
{
$p_total += $p_20;
break;
}
case ("40"):
{
$p_total += $p_40;
break;
}
case ("60"):
{
$p_total += $p_60;
break;
}
case ("80"):
{
$p_total += $p_80;
break;
}
case ("120"):
{
$p_total += $p_120;
break;
}
}
switch ( $_COOKIEї'hd2'] )
{
case ("20"):
{
$p_total += $p_20;
break;
}
case ("40"):
{
$p_total += $p_40;
break;
}
case ("60"):
{
$p_total += $p_60;
break;
}
case ("80"):
{
$p_total += $p_80;
break;
}
case ("120"):
{
$p_total += $p_120;
break;
}
}
switch ( $_COOKIEї'ram'] )
{
case ("128DDR"):
{
$p_total += $p_128DDR;
break;
}
case ("256DDR"):
{
$p_total += $p_256DDR;
break;
}
case ("512DDR"):
{
$p_total += $p_512DDR;
break;
}
case ("256DDR333"):
{
$p_total += $p_256DDR333;
break;
}
case ("512DDR333"):
{
$p_total += $p_512DDR333;
break;
}
}
switch ( $_COOKIEї'cd1'] )
{
case ("cd"):
{
$p_total += $p_cd;
break;
}
case ("cd_black"):
{
$p_total += $p_cd_black;
break;
}
case ("cdr"):
{
$p_total += $p_cdr;
break;
}
case ("cdr_black"):
{
$p_total += $p_cdr_black;
break;
}
case ("dvd"):
{
$p_total += $p_dvd;
break;
}
case ("dvd_black"):
{
$p_total += $p_dvd_black;
break;
}
case ("combo"):
{
$p_total += $p_combo;
break;
}
case ("combo_black"):
{
$p_total += $p_combo_black;
break;
}
case ("dvdrw"):
{
$p_total += $p_dvdrw;
break;
}
}
switch ( $_COOKIEї'cd2'] )
{
case ("cd"):
{
$p_total += $p_cd;
break;
}
case ("cd_black"):
{
$p_total += $p_cd_black;
break;
}
case ("cdr"):
{
$p_total += $p_cdr;
break;
}
case ("cdr_black"):
{
$p_total += $p_cdr_black;
break;
}
case ("dvd"):
{
$p_total += $p_dvd;
break;
}
case ("dvd_black"):
{
$p_total += $p_dvd_black;
break;
}
case ("combo"):
{
$p_total += $p_combo;
break;
}
case ("combo_black"):
{
$p_total += $p_combo_black;
break;
}
case ("dvdrw"):
{
$p_total += $p_dvdrw;
break;
}
}
switch ( $_COOKIEї'floppy1'] )
{
case ("floppy"):
{
$p_total += $p_floppy;
break;
}
case ("floppy_black"):
{
$p_total += $p_floppy_black;
break;
}
case ("zip"):
{
$p_total += $p_zip;
break;
}
}
switch ( $_COOKIEї'floppy2'] )
{
case ("floppy"):
{
$p_total += $p_floppy;
break;
}
case ("floppy_black"):
{
$p_total += $p_floppy_black;
break;
}
case ("zip"):
{
$p_total += $p_zip;
break;
}
}
if ( $_COOKIEї'modem'] == "modem" )
{
$p_total += $p_modem;
}
if ( $_COOKIEї'nic'] == "nic" )
{
$p_total += $p_nic;
}
switch ( $_COOKIEї'keyboard'] )
{
case ("regular"):
{
$p_total += $p_keyboard;
break;
}
case ("regular_black"):
{
$p_total += $p_keyboard_black;
break;
}
case ("wireless"):
{
$p_total += $p_keyboard_wireless;
break;
}
case ("wireless_black"):
{
$p_total += $p_keyboard_wireless_black;
break;
}
}
switch ( $_COOKIEї'monitor'] )
{
case ("mon17"):
{
$p_total += $p_mon17;
break;
}
case ("mon17_black"):
{
$p_total += $p_mon17_black;
break;
}
case ("mon17flat"):
{
$p_total += $p_mon17flat;
break;
}
case ("mon17flat_black"):
{
$p_total += $p_mon17flat_black;
break;
}
case ("mon19flat"):
{
$p_total += $p_mon19flat;
break;
}
case ("mon19flat_black"):
{
$p_total += $p_mon19flat_black;
break;
}
case ("mon22flat"):
{
$p_total += $p_mon22flat;
break;
}
case ("mon22flat_black"):
{
$p_total += $p_mon22flat_black;
break;
}
}
switch ( $_COOKIEї'speakers'] )
{
case ("benwin2pc"):
{
$p_total += $p_benwin2pc;
break;
}
case ("cyber2pc"):
{
$p_total += $p_cyber2pc;
break;
}
case ("creative3pc"):
{
$p_total += $p_creative3pc;
break;
}
case ("logitech3pc"):
{
$p_total += $p_logitech3pc;
break;
}
case ("logitech5pc"):
{
$p_total += $p_logitech5pc;
break;
}
case ("klipsch6pc"):
{
$p_total += $p_klipsch6pc;
break;
}
}
switch ( $_COOKIEї'os'] )
{
case ("windowsxphome"):
{
$p_total += $p_winxphome;
break;
}
case ("windowsxppro"):
{
$p_total += $p_winxppro;
break;
}
case ("windows2k"):
{
$p_total += $p_win2k;
break;
}
}
switch ( $_COOKIEї'soft1'] )
{
case ("norton"):
{
$p_total += $p_norton;
break;
}
}
switch ( $_COOKIEї'soft2'] )
{
case ("works"):
{
$p_total += $p_works;
break;
}
case ("officexp"):
{
$p_total += $p_officexp;
break;
}
}
switch ( $_COOKIEї'video'] )
{
case ("ati7500"):
{
$p_total += $p_ati7500;
break;
}
case ("ati8500"):
{
$p_total += $p_ati8500;
break;
}
case ("gf4ti4200"):
{
$p_total += $p_gf4ti4200;
break;
}
case ("gf4ti4400"):
{
$p_total += $p_gf4ti4400;
break;
}
case ("gf4ti4600"):
{
$p_total += $p_gf4ti4600;
break;
}
}
$p_total += $p_extras;
$p_total *= 1.3;
Setcookie(total, $p_total, time() + 36000);
header("Location: custom_builder_power.php");
?>
Thanks again for any help.