|
| Index | Recent Threads | Unanswered Threads | Who's Online | User List | Help |
|
|
| No member browsing this thread |
|
Thread Status: Active Total posts in this thread: 10
|
|
| Author |
|
|
Stranger Joined: Jul 30, 2008 Post Count: 16 Status: Offline |
I am having problems with my website. When trying to check out on the checkout.php page the code is producing an infinite loop which of course is not allowing the page to show up. I don't have much experience in php coding so I don't really know what to look for to stop it. I will paste the code below. I hope I'm not being too vague but as I stated earlier I don't really know what I'm talking about. I appreciate any help or advice in this matter. <?php include_once "./conf.php"; session_save_path(conf::get('realpath')."tmp"); //session_save_path("/home/users/web/b2996/as.money44/cgi-bin/tmp"); session_start(); header("Cache-control: private"); // IE 6 Fix. $username=conf::get('dbuser'); $password=conf::get('dbpassword'); $database=conf::get('dbname'); mysql_connect(conf::get('dbhost'),$username,$password); @mysql_select_db($database) or die("Unable to select database"); $type=""; $Color=""; $Style=""; $Lines=""; $SKU =""; $Quantity=""; $Price=""; $desc=""; $short_desc=""; //tests to see if the client is coming from the checkout page and accordingly gives the correct cart item number(that is not empty) $prechange = $_SESSION["item"]; if ($_POST['action'] == "Checkout" || $_GET['back'] == "yes") { //$_SESSION["item"] = 0; $rcsize=sizeof($_SESSION['cart']); //The following for loop is used to track the first new item in the reordercart. for($rccounter=0;$rccounter<$rcsize;$rccounter++) { if($_SESSION['cart'][$rccounter]!= null) break; } $_SESSION["item"] = $rccounter; //Checks to see if the cart contains a non-print item it increments the session item or sends it to the next step $Product_ID = $_SESSION["cart"][$_SESSION["item"]]["Product_ID"]; $nonprintQry = "SELECT * FROM products WHERE Product_ID = '$Product_ID'"; $nonprintresultQry = mysql_query($nonprintQry); $npnum = mysql_num_rows($nonprintresultQry); $i=0; while ($i < $npnum) { $type = mysql_result($nonprintresultQry,$i,"type"); $i++; } if($type == "non-print") { header("Location: preview.php"); } while (empty($_SESSION["cart"][$_SESSION["item"]])){ $nextnewitem=$_SESSION["item"]; for($rccounter=$nextnewitem;$rccounter<$rcsize;$rccounter++) { if($_SESSION['cart'][$rccounter]!= null) break; } $_SESSION["item"] = $rccounter; //Checks to see if the cart contains a non-print item it increments the session item or sends it to the next step $Product_ID = $_SESSION["cart"][$_SESSION["item"]]["Product_ID"]; $nonprintQry = "SELECT * FROM products WHERE Product_ID = '$Product_ID'"; print "$nonprintQry<br>"; $nonprintresultQry = mysql_query($nonprintQry); $npnum = mysql_num_rows($nonprintresultQry); $i=0; while ($i < $npnum) { $type = mysql_result($nonprintresultQry,$i,"type"); $i++; } if($type == "non-print") { header("Location: preview.php"); } } } else { //$_SESSION["item"]++; $nextnewitem=$_SESSION["item"]; $rcsize=sizeof($_SESSION['cart']); for($rccounter=$nextnewitem+1;$rccounter<$rcsize;$rccounter++) { if($_SESSION['cart'][$rccounter] != null) break; } $_SESSION["item"] = $rccounter; //Checks to see if the cart contains a non-print item it increments the session item or sends it to the next step $Product_ID = $_SESSION["cart"][$_SESSION["item"]]["Product_ID"]; $nonprintQry = "SELECT * FROM products WHERE Product_ID = '$Product_ID'"; $nonprintresultQry = mysql_query($nonprintQry); $npnum = mysql_num_rows($nonprintresultQry); $i=0; while ($i < $npnum) { $type = mysql_result($nonprintresultQry,$i,"type"); $i++; } if($type == "non-print") { header("Location: preview.php"); } //Tests to see if the session cart item is empty and loops through until it finds something while (empty($_SESSION["cart"][$_SESSION["item"]]) && $_SESSION["item"] < sizeof($_SESSION["cart"])){ $_SESSION["item"]++; //Checks to see if the cart contains a non-print item it increments the session item or sends it to the next step $Product_ID = $_SESSION["cart"][$_SESSION["item"]]["Product_ID"]; $nonprintQry = "SELECT * FROM products WHERE Product_ID = '$Product_ID'"; $nonprintresultQry = mysql_query($nonprintQry); $npnum = mysql_num_rows($nonprintresultQry); $i=0; while ($i < $npnum) { $type = mysql_result($nonprintresultQry,$i,"type"); $i++; } if($type == "non-print") { header("Location: preview.php"); } } } mysql_close(); //If the person decides the preview is incorrect, it reassigns the same cart item number if (isset($_POST['incorrect']) && $_POST['incorrect'] == "yes") { $_SESSION["item"] = $_POST['item']; } //If the person clicks the back arrow, it maintains the same cart item number if (isset($_GET['back']) && $_GET['back'] == "yes") { $_SESSION["item"] = $prechange; } $cartItem = $_SESSION["item"]; $Product_ID = $_SESSION["cart"][$cartItem]['Product_ID']; $itemStyle_ID = $_SESSION["cart"][$cartItem]['style_ID']; $itemPricing_ID = $_SESSION["cart"][$cartItem]['price_ID']; $itemparts = $_SESSION["cart"][$cartItem]['parts']; $username=conf::get('dbuser'); $password=conf::get('dbpassword'); $database=conf::get('dbname'); mysql_connect(conf::get('dbhost'),$username,$password); @mysql_select_db($database) or die("Unable to select database"); $query = "SELECT * FROM products WHERE Product_ID = '$Product_ID'"; $result = mysql_query($query); $num = mysql_num_rows($result); $query2 = "SELECT * FROM style_color WHERE Style_Color_ID = '$itemStyle_ID'"; $result2 = mysql_query($query2); $num2 = mysql_num_rows($result2); $query3 = "SELECT * FROM pricing WHERE Pricing_ID = '$itemPricing_ID'"; $result3 = mysql_query($query3); $num3 = mysql_num_rows($result3); mysql_close(); $i=0; while ($i < $num) { $Product_ID = mysql_result($result,$i,"Product_ID"); $SKU = mysql_result($result,$i,"SKU"); $short_desc = mysql_result($result,$i,"short_desc"); $desc = mysql_result($result,$i,"pdesc"); $icon_img_link = mysql_result($result,$i,"icon_img_link"); $small_img_link = mysql_result($result,$i,"small_img_link"); $large_img_link = mysql_result($result,$i,"large_img_link"); $type = mysql_result($result,$i,"type"); $i++; } $i=0; while ($i < $num2) { $Style_Color_ID = mysql_result($result2,$i,"Style_Color_ID"); $Style = mysql_result($result2,$i,"Style"); $Color = mysql_result($result2,$i,"Color"); $Lines = mysql_result($result2,$i,"SLines"); $Proof_Link = mysql_result($result2,$i,"Proof_Link"); $i++; } $i=0; while ($i < $num3) { $Pricing_ID = mysql_result($result3,$i,"Pricing_ID"); $Quantity = mysql_result($result3,$i,"Quantity"); $Price = mysql_result($result3,$i,"Price"); $i++; } ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Step 1 - Imprint Information</title> <script language="javascript"> function chngPrpty() { if(document.FormName.voidAfter.checked==true) { document.getElementById("txtDays").readOnly=""; document.getElementById("txtDays").focus(); } else { document.getElementById("txtDays").value=""; document.getElementById("txtDays").readOnly="readonly"; } } function checkDays() { if(document.FormName.voidAfter.checked==true) { if(document.getElementById("txtDays").value==0 || isNaN(document.FormName.txtDays.value)) { alert("Please specify the days after which your order will be void."); return false; } } } </script> </head> <body bgcolor="#857e54" text="#464526" link="#003399" vlink="#660066" alink="#464526"> <table width="600" border="1" align="center" cellpadding="0" cellspacing="0"> <tr> <td bgcolor="cccc99"><div align="right"><a href="index.php"><img src="images/Header1.jpg" width="700" height="50" border="0"></a></div></td> </tr> <tr> <td bgcolor="#cccc99"> <div class="story"> <form id="FormName" action="checkout2.php" method="post" name="FormName"> <table width="90%" border="0" align="center" cellpadding="4" cellspacing="2"> <tr valign="top"> <td colspan="2"> <div align="center"> <font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif"><a href="cartedit.php"><< Back to Cart</a> <a href="product_list.php"><< Back to Products</a></font></div> </td> </tr> <tr valign="top" bgcolor="#464526"> <td colspan="2"> <div align="center"> <p align="center"><font color="#333333" size="3" face="Verdana"><strong><font color="#FFFFFF" face="Verdana, Arial, Helvetica, sans-serif">Step 1 - Imprint Information<br> </font></strong></font><font color="#FFFFFF" face="Verdana, Arial, Helvetica, sans-serif"><span class="bodycopy"><font size="2">Please complete the information below for product imprint information.<br> If you have any questions, please call 407-877-7222</font></span></font> <span class="bodycopy"><font color="#FFFFFF" size="2" face="Geneva, Arial, Helvetica, sans-serif"><br /> </font></span></p> </div> </td> </tr> <tr valign="top"> <td> <table border="0" cellspacing="2" cellpadding="0"> <tr> <td width="98"> <div align="left"> <font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif"><b>SKU</b></font></div> </td> <td width="64"> <div align="left"> <font size="2" color="blue" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif"><? echo $SKU; ?> </font></div> </td> <td><font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif"><a href="editproduct.php?editline=<? echo $cartItem; ?>">(Edit Product)</a></font></td> </tr> <tr> <td width="98"> <div align="left"> <font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Description</font></div> </td> <td colspan="2"> <div align="left"> <font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif"><? echo $short_desc; ?></font></div> </td> </tr> <tr> <td valign="top" width="98"> <div align="left"> <font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Summary</font></div> </td> <td colspan="2"> <div align="left"> <font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif"><? echo $desc; ?></font></div> </td> </tr> <? if($type == "stamp") {?> <tr> <td width="98"><font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Ink Color</font></td> <td colspan="2"><font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif"><? echo $Color; ?></font></td> </tr> <?} if(isCheck($type)) {?> <tr> <td width="98"><font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Style/Color</font></td> <td colspan="2"><font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif"><? echo $Style; ?> / <? echo $Color; ?> / <? echo $Lines; ?></font></td> </tr> <?}?> <tr> <td width="98"><font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Quantity/Price</font></td> <td colspan="2"><font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif"><? echo $Quantity; ?> / $<? echo $Price; ?></font></td> </tr> <? if(isCheck($type) || isDeposit($type)) {?> <tr> <td width="98"><font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Parts (Colors)</font></td> <td colspan="2"><font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif"><? echo $_SESSION["cart"][$cartItem]["parts"]; ?></font></td> </tr> <?}?> </table> <br> <br> <br> <br> <br> <? if (isCheck($type)) {?> <table width="316" border="0" cellspacing="2" cellpadding="0"> <tr bgcolor="#464526"> <td> <div align="left"> <font color="#FFFFFF" size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif"><b>Options: </b></font></div> </td> <td> <div align="right"> <font color="#FFFFFF" size="-2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">(Help)</font></div> </td> </tr> <tr> <td> <div align="left"> <font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Check Starting #:</font></div> </td> <td><input type="text" name="startNo" value="<? echo $_SESSION["cart"][$_SESSION["item"]]["startNo"]; ?>" size="7" maxlength="6"></td> </tr> <tr> <td> <div align="left"> <font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Checks Printing Software:<br> </font><font size="-2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">(Ex: Quickbooks or Peachtree)</font></div> </td> <td valign="top"><input type="text" name="software" value="<? echo stripslashes($_SESSION["cart"][$_SESSION["item"]]["software"]); ?>" size="20"></td> </tr> <tr> <td> <div align="left"> <font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Checks Usage</font></div> </td> <td><select name="usage" size="1"> <option <? if ($_SESSION["cart"][$_SESSION["item"]]["usage"] == "General Use") { echo "selected"; }?> value="General Use">General Use</option> <option <? if ($_SESSION["cart"][$_SESSION["item"]]["usage"] == "Accounts Payable") { echo "selected"; }?>value="Accounts Payable">Accounts Payable</option> <option <? if ($_SESSION["cart"][$_SESSION["item"]]["usage"] == "Payroll") { echo "selected"; }?>value="Payroll">Payroll</option> <option <? if ($_SESSION["cart"][$_SESSION["item"]]["usage"] == "Escrow") { echo "selected"; }?>value="Escrow">Escrow</option> <option <? if ($_SESSION["cart"][$_SESSION["item"]]["usage"] == "Operating Account") { echo "selected"; }?>value="Operating Account">Operating Account</option> </select></td> </tr> </table> <?}?><? if($type == "stamp") {?> <table width="337" border="0" cellspacing="2" cellpadding="0"> <tr bgcolor="#464526"> <td width="154"> <div align="left"> <font color="#FFFFFF" size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif"><b>Stamp Imprint: </b></font><font color="#FFFFFF" size="-2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">(Help)</font></div> </td> <td colspan="3"><font color="#FFFFFF"> </font></td> </tr> <tr> <td width="154"> <div align="left"> <font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Line 1: </font><font size="-2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">(Ex: Company Name)</font></div> </td> <td colspan="3"><input type="text" name="Line1" value="<? echo stripslashes($_SESSION["cart"][$_SESSION["item"]]["Line1"]); ?>" size="25"></td> </tr> <tr> <td width="154"> <div align="left"> <font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Line 2: </font><font size="-2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">(Ex: Address)</font></div> </td> <td colspan="3" valign="top"><input type="text" name="Line2" value="<? echo stripslashes($_SESSION["cart"][$_SESSION["item"]]["Line2"]); ?>" size="25"></td> </tr> <tr> <td width="154"> <div align="left"> <font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Line 3: </font><font size="-2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">(Ex: City/State/Zip)</font></div> </td> <td colspan="3"><input type="text" name="Line3" value="<? echo stripslashes($_SESSION["cart"][$_SESSION["item"]]["Line3"]); ?>" size="25"></td> </tr> <tr> <td width="154"><font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Line 4: </font><font size="-2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">(Ex: Phone Number)</font></td> <td colspan="3"><input type="text" name="Line4" value="<? echo stripslashes($_SESSION["cart"][$_SESSION["item"]]["Line4"]); ?>" size="25"></td> </tr> <tr> <td width="154"><font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Line 5: </font><font size="-2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">(Ex: Web Site)</font></td> <td colspan="3"><input type="text" name="Line5" value="<? echo stripslashes($_SESSION["cart"][$_SESSION["item"]]["Line5"]); ?>" size="25"></td> </tr> <tr> <td width="154"><font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Text Case:</font></td> <td colspan="3"><input type="radio" name="case" value="caps" <? if ($_SESSION["cart"][$_SESSION["item"]]["case"] == "caps" || $_SESSION["cart"][$_SESSION["item"]]["case"] == "") { echo "checked"; }?>><font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">CAPS </font><input type="radio" name="case" value="upper_lower" <? if ($_SESSION["cart"][$_SESSION["item"]]["case"] == "upper_lower") { echo "checked"; }?>><font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Upper & Lower </font></td> </tr> <tr> <td width="154"><font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Text Alignment:</font></td> <td colspan="3"><input type="radio" name="align" value="Left" <? if ($_SESSION["cart"][$_SESSION["item"]]["align"] == "Left" || $_SESSION["cart"][$_SESSION["item"]]["align"] == "") { echo "checked"; }?>><font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Left </font><input type="radio" name="align" value="Center"<? if ($_SESSION["cart"][$_SESSION["item"]]["align"] == "Center") { echo "checked"; }?>><font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Center</font></td> </tr> <tr> <td width="154"><font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Line 2 Options:</font></td> <td colspan="3"><input type="checkbox" name="line2bold" value="yes" <? if ($_SESSION["cart"][$_SESSION["item"]]["line2bold"] == "yes") { echo "checked"; }?>> <font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Print Line 2 Bold</font></td> </tr> <tr> <td> </td> <td width="110"><font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif"> <input type="checkbox" name="voidAfter" value="yes" <? if ($_SESSION["cart"][$_SESSION["item"]]["voidafter"] == "yes") { echo "checked"; }?> onClick="chngPrpty();"> <font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">VOID</font> AFTER</font></td> <td width="13"><input type="text" size="1" name="txtDays" id="txtDays" readonly="readonly" maxlength="3" value="<?php if ($_SESSION["cart"][$_SESSION["item"]]["voidafter"] == "yes") { echo $_SESSION["cart"][$_SESSION["item"]]["voidDays"]; }?>"></td> <td width="50"><font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif"> DAYS.</font></td> </tr> </table> <?}?></td> <td> <div align="center"> <p><img src="<? if(isCheck($type)) { echo $Proof_Link; } else { echo $large_img_link; } ?>" alt="" width="300" border="0"></p> </div> </td> </tr> <tr valign="top"> <td><? if(isCheck($type) || isDeposit($type)) { ?> <p><font size="2" color="#FF0000" face="Arial, Helvetica, sans-serif"><strong>Send Artwork to: <a href="mailto:prepress@dailygraphics.net">prepress@dailygraphics.net</a></strong></font></p> <table width="344" border="0" cellspacing="2" cellpadding="0"> <tr bgcolor="#464526"> <td width="143"> <div align="left"> <font color="#FFFFFF" size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif"><b>Customer Imprint: </b></font><font color="#FFFFFF" size="-2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">(Help)</font></div> </td> <td colspan="3"><font color="#FFFFFF"> <input type="checkbox" name="logo" value="yes" <? if ($_SESSION["cart"][$_SESSION["item"]]["logo"] == "yes") { echo "checked"; }?>> <font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif"> Company Logo </font></font><font color="#FFFFFF" size="-2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">(FREE)</font></td> </tr> <tr> <td width="143"> <div align="left"> <font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Line 1: </font><font size="-2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">(Ex: Company Name)</font></div> </td> <td colspan="3"><input type="text" name="Line1" value="<? echo stripslashes($_SESSION["cart"][$_SESSION["item"]]["Line1"]); ?>" size="25"></td> </tr> <tr> <td width="143"> <div align="left"> <font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Line 2: </font><font size="-2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">(Ex: Address)</font></div> </td> <td colspan="3" valign="top"><input type="text" name="Line2" value="<? echo stripslashes($_SESSION["cart"][$_SESSION["item"]]["Line2"]); ?>" size="25"></td> </tr> <tr> <td width="143"> <div align="left"> <font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Line 3: </font><font size="-2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">(Ex: City/State/Zip)</font></div> </td> <td colspan="3"><input type="text" name="Line3" value="<? echo stripslashes($_SESSION["cart"][$_SESSION["item"]]["Line3"]); ?>" size="25"></td> </tr> <tr> <td width="143"><font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Line 4: </font><font size="-2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">(Ex: Phone Number)</font></td> <td colspan="3"><input type="text" name="Line4" value="<? echo stripslashes($_SESSION["cart"][$_SESSION["item"]]["Line4"]); ?>" size="25"></td> </tr> <tr> <td width="143"><font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Line 5: </font><font size="-2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">(Ex: Web Site)</font></td> <td colspan="3"><input type="text" name="Line5" value="<? echo stripslashes($_SESSION["cart"][$_SESSION["item"]]["Line5"]); ?>" size="25"></td> </tr> <tr> <td width="143"><font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Text Case:</font></td> <td colspan="3"><input type="radio" name="case" value="caps" <? if ($_SESSION["cart"][$_SESSION["item"]]["case"] == "caps" || $_SESSION["cart"][$_SESSION["item"]]["case"] == "") { echo "checked"; }?>><font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">CAPS </font><input type="radio" name="case" value="upper_lower" <? if ($_SESSION["cart"][$_SESSION["item"]]["case"] == "upper_lower") { echo "checked"; }?>><font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Upper & Lower </font></td> </tr> <tr> <td width="143"><font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Text Alignment:</font></td> <td colspan="3"><input type="radio" name="align" value="Left" <? if ($_SESSION["cart"][$_SESSION["item"]]["align"] == "Left" || $_SESSION["cart"][$_SESSION["item"]]["align"] == "") { echo "checked"; }?>><font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Left </font><input type="radio" name="align" value="Center"<? if ($_SESSION["cart"][$_SESSION["item"]]["align"] == "Center") { echo "checked"; }?>><font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Center</font></td> </tr> <tr> <td width="143"><font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Line 2 Options:</font></td> <td colspan="3"><input type="checkbox" name="line2bold" value="yes" <? if ($_SESSION["cart"][$_SESSION["item"]]["line2bold"] == "yes") { echo "checked"; }?>> <font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Print Line 2 Bold</font></td> </tr> <? if(isCheck($type)) {?> <tr> <td width="143"></td> <td colspan="3"><input type="checkbox" name="line2voucher" value="yes" <? if ($_SESSION["cart"][$_SESSION["item"]]["line2voucher"] == "yes") { echo "checked"; }?>> <font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Print Line 2 on Voucher</font></td> </tr> <tr> <td></td> <td colspan="3"><input type="checkbox" name="line1and2same" value="yes" <? if ($_SESSION["cart"][$_SESSION["item"]]["line1and2same"] == "yes") { echo "checked"; }?>> <font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Print Line 1 & 2 the Same</font></td> </tr> <tr> <td><div align="right"></div></td> <td width="106" valign="middle"><font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif"> <input type="checkbox" name="voidAfter" value="yes" <? if ($_SESSION["cart"][$_SESSION["item"]]["voidafter"] == "yes") { echo "checked"; }?> onClick="chngPrpty();"> <font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">VOID</font> AFTER</font></td> <td width="27" valign="middle"><input type="text" size="1" name="txtDays" id="txtDays" readonly="readonly" maxlength="3" value="<?php if ($_SESSION["cart"][$_SESSION["item"]]["voidafter"] == "yes") { echo $_SESSION["cart"][$_SESSION["item"]]["voidDays"]; }?>"></td> <td width="58" valign="middle"><font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif"> DAYS.</font></td> </tr> <?}?> </table> <?}?></td> <td> <? if(isCheck($type) || isDeposit($type)) { ?> <table width="328" border="0" cellspacing="2" cellpadding="0"> <tr bgcolor="#464526"> <td width="160"> <div align="left"> <font color="#FFFFFF" size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif"><b>Bank Imprint: </b></font></div> </td> <td> <div align="right"> <font color="#FFFFFF" size="-2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">(Help)</font></div> </td> </tr> <tr> <td width="160"> <div align="left"> <font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Line 1: </font><font size="-2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">(Ex: Bank Name)</font></div> </td> <td><input type="text" name="BLine1" value="<? echo stripslashes($_SESSION["cart"][$_SESSION["item"]]["BLine1"]); ?>" size="25"></td> </tr> <tr> <td width="160"> <div align="left"> <font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Line 2: </font><font size="-2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">(Ex: Location)</font></div> </td> <td valign="top"><input type="text" name="BLine2" value="<? echo stripslashes($_SESSION["cart"][$_SESSION["item"]]["BLine2"]); ?>" size="25"></td> </tr> <tr> <td width="160"> <div align="left"> <font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Line 3: </font><font size="-2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">(Ex: Location)</font></div> </td> <td><input type="text" name="BLine3" value="<? echo stripslashes($_SESSION["cart"][$_SESSION["item"]]["BLine3"]); ?>" size="25"></td> </tr> <tr> <td width="160"><font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Line 4: </font><font size="-2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">(Ex: Location)</font></td> <td><input type="text" name="BLine4" value="<? echo stripslashes($_SESSION["cart"][$_SESSION["item"]]["BLine4"]); ?>" size="25"></td> </tr> <tr> <td width="160"><font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Fractional Routing #:<br> </font><font size="-2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">(Ex: 12-345/678)</font></td> <td valign="top"><input type="text" name="frac" value="<? echo $_SESSION["cart"][$_SESSION["item"]]["frac"]; ?>" size="25"></td> </tr> <tr> <td width="160"><font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Branch #:</font><font size="-2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">(Ex: 90)</font></td> <td valign="top"><input type="text" name="branch" value="<? echo $_SESSION["cart"][$_SESSION["item"]]["branch"]; ?>" size="5"></td> </tr> <? if(isCheck($type)) {?> <tr> <td width="160"><font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Extra Options:</font></td> <td valign="top"><input type="checkbox" name="dblsig" value="yes" <? if ($_SESSION["cart"][$_SESSION["item"]]["dblsig"] == "yes") { echo "checked"; }?>> <font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Double Signature Lines</font></td> </tr> <?}?> </table> <?}?> </td> </tr> <tr valign="top"> <td colspan="2"> <div align="center"> <br> <table border="0" cellspacing="2" cellpadding="0"> <tr bgcolor="#bdbd8d"> <td width="555" bgcolor="#464526"> <div align="left"> <font color="#FFFFFF" size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif"><b>Special Instructions: </b></font></div> </td> </tr> <tr> <td width="555"> <div align="center"> <font size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">You may state any special instructions with respect to printing in this box.</font></div> </td> </tr> <tr> <td width="555"> <div align="center"> <textarea name="instruc" rows="4" cols="71"><? echo stripslashes($_SESSION["cart"][$_SESSION["item"]]["instruc"]); ?></textarea></div> </td> </tr> </table> <br> <? if(isCheck($type) || isDeposit($type)) {?> <table width="555" border="0" cellspacing="2" cellpadding="0"> <tr bgcolor="#464526"> <td colspan="2"> <div align="left"> <font color="#FFFFFF" size="2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif"><b>MICR Information: </b></font></div> </td> <td> <div align="right"> <font color="#FFFFFF" size="-2" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">(Help)</font></div> </td> </tr> <tr> <td align="right" valign="top" width="18"> <div align="right"> <input type="radio" name="MICR" value="customer" <? if ($_SESSION["cart"][$_SESSION["item"]]["MICR"] == "customer" || $_SESSION["cart"][$_SESSION["item"]]["MICR"] == "") { echo "checked"; }?>></div> </td> <td colspan="2"><font size="2" face="arial,verdana,helvetica">I will complete "MICR" order sheet on-line (on the next page). </font><font size="-1" face="arial,verdana,helvetica">(Please note that without a faxed sample of your check or deposit slip, checks.org can not verify the accuracy of same, and the customer assumes all liability for the imprint accuracy of the MICR information.)</font></td> </tr> <tr> <td valign="top" width="18"> <div align="right"> <input type="radio" name="MICR" value="us" <? if ($_SESSION["cart"][$_SESSION["item"]]["MICR"] == "us") { echo "checked"; }?>></div> </td> <td colspan="2" valign="top"><font size="2" face="arial,verdana,helvetica">Have checks.org complete the MICR for me: </font><font size="-1" face="arial,verdana,helvetica">I will fax a copy of my existing check/deposit slip/re-order form from a previous supplier, or a MICR specification sheet to checks.org at 407.877.9236</font></td> </tr> </table> <?}?> </div> </td> </tr> <tr valign="top"> <td> <div align="left"></div> </td> <td align="right"> <div align="right"> <input type="submit" name="continue" value="Continue to Next Step" onClick="return checkDays();"><br> </div> </td> </tr> </table> </form> <div align="center"><br> <font face="Verdana, Arial, Helvetica, sans-serif"><strong><font color="#464526" size="1">*For customers ordering multiple items requiring imprints, this process will be repeated for each item.</font><font size="1"></font></strong></font><font size="1" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif"> <br> </font></div> </div> </td> </tr> </table> </body> </html> <? //Tests to see if the type is a check (to save time of writing SUPER long if statments all over in the code function isCheck($type_test) { if($type_test == "topcheck" || $type_test == "middlecheck" || $type_test == "bottomcheck" || $type_test == "3ppcheck" || $type_test == "3ppwalletcheck" || $type_test == "conttopcheck" || $type_test == "contbottomcheck" || $type_test == "manualcheck") return true; else return false; } function isDeposit($type_test) { if($type_test == "deposit" || $type_test == "printdeposit") return true; else return false; } ?> ---------------------------------------- [Edit 1 times, last edit by admin at Dec 7, 2008 7:16:01 PM] |
||
|
|
Advanced Member USA Joined: Aug 14, 2007 Post Count: 1129 Status: Offline |
That's a lot of code to try to go through, especially since I'm not familiar with your app. I'd suggest starting simple -- commenting out different pieces of code until you know exactly which loop is causing the problem. Once you know that, post that code, and we should be able to help out more. ---------------------------------------- Benjamin Falk | student : designer : developer Twitter: falkencreative |
||
|
|
Stranger Joined: Jul 30, 2008 Post Count: 16 Status: Offline |
I hope I don't sound stupid but what do I need to look for that indicates an infinite loop once I comment out the sections of code? Sorry about the lengthy code. ---------------------------------------- [Edit 1 times, last edit by dailygraphics at Dec 8, 2008 8:54:27 AM] |
||
|
|
Advanced Member USA Joined: Aug 14, 2007 Post Count: 1129 Status: Offline |
Basically, I'm suggesting commenting out sections of the code and viewing the page. If the page appears, you know the commented out section includes the error. What are you currently getting when you try to view the page? A blank page? If so, are you sure it is an infinite loop? It could be a syntax error of some sort. Do you have error reporting turned on in your PHP ini file, so that errors will display if they occur? ---------------------------------------- Benjamin Falk | student : designer : developer Twitter: falkencreative |
||
|
|
Stranger Joined: Jul 30, 2008 Post Count: 16 Status: Offline |
The error that I'm receiving is, "The server encountered an unexpected condition which prevented it from fulfilling the request. The script had an error or it did not produce any output. If there was an error, you should be able to see it in the error log." It started this about two weeks ago and I've never had this problem before. I contacted my host support and they came to the conclusion that the php code for this particular page was querying the MYSQL database in an infinite loop. We have had some scripting worked on in the past month and I've done some cosmetic stuff but like I said the site has worked fine up until this point. I'm not a programmer and am very unfamiliar with php and such, that is why I turned to killersites for help. With that being said I will see what I can do with commenting out the code. Thanks for the help. |
||
|
|
Advanced Member USA Joined: Aug 14, 2007 Post Count: 1129 Status: Offline |
"The script had an error or it did not produce any output. If there was an error, you should be able to see it in the error log." Have you checked the error log (or did support step you through that process? Should be in your hosting control panel. ---------------------------------------- Benjamin Falk | student : designer : developer Twitter: falkencreative |
||
|
|
Stranger Joined: Jul 30, 2008 Post Count: 16 Status: Offline |
The errors that I'm receiving for the problem page are: PHP Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /hermes/web09/b2996/as.money44/checkout.php on line 41 PHP Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /hermes/web09/b2996/as.money44/checkout.php on line 143 PHP Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /hermes/web09/b2996/as.money44/checkout.php on line 147 PHP Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /hermes/web09/b2996/as.money44/checkout.php on line 151 I don't know if this helps though. |
||
|
|
Newbie Joined: Aug 16, 2007 Post Count: 42 Status: Offline |
To look for a infinite loop is quite simple, if you loop until you hit a true or false statement using let say do {} while {} and the statement never hits/encounters that true or false statement you will get an infinite loop. PHP Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /hermes/web09/b2996/as.money44/checkout.php on line 41 You could be using it wrong here, this php function is only to be used to get the number of "affected" rows from a result set; in other words when using select or show and only gives you a number of "hits". For other queries where you use insert, update, delete etc.. you have to use the function mysql_affected_rows() You need to debugg your code, that is done one code snippet at a time, make sure all the sub pieces, functions of code work for themselves before you start puting them together into larger pieces. |
||
|
|
Stranger Joined: Jul 30, 2008 Post Count: 16 Status: Offline |
Thanks for taking the time to reply. I hope I don't sound ignorant but I really don't know what I'm doing. I have basically been thrown into website maintenance and I really want to learn the ins and outs but with no prior knowledge it's confusing. If someone could point me in the right direction as to how to debug my script or if there is any program that will help me I think that would be helpful. I have a professional programmer looking at it but I would like to get this resolved soon. If it's any help, my website was working fine one week and the next it wasn't. The only thing I personally did was insert rows in my MYSQL database for new products. Could this be the probelm? Would this explain the infinite loop on my database? Like I said I have no idea, I'm just looking for clues. Thanks, Angela |
||
|
|
Stranger Joined: Jul 30, 2008 Post Count: 16 Status: Offline |
Thank you falkencreative and krillz for the pointers for this problem. After going round and round with my hosting it was determined that the root path was changed on the server and also session save path which was causing the website to function improperly. It had nothing to do with the script. Thanks once again for the help. |
||
|
|
|
|
|
Current timezone is GMT Mar 17, 2010 2:01:57 AM |