หัวข้อ: ช่วยด้วยครับ เรื่อง ระบบตะกร้าครับ หน้าขาว เริ่มหัวข้อโดย: kangpla ที่ 03 ธันวาคม 2013, 02:59:34 สั่งซื้อแล้วหน้าขาวเพราะ..... :wanwan017:
เนื่องจาด ซ๊อตที่ได้มาเป็นอย่างนี้ครับ( ด้านล่าง ) แต่เซอเวอร์ที่เช่าใช้ php เวอชั่น 5.4 แต่ php ที่ใด้มาเป็นcodeเวอร์ชั่น php 4 ผมต้องแก้อย่างไร เพื่อให้สามารถใช้งานได้ .code ใน file ....== basket_cal.php ==...เป็น <?php session_start(); include("inc/config.inc.php"); if(count($prd_del)=="0"){ $prd_del=array(); } for($i=0;$i<count($sess_id);$i++){ if(!in_array($sess_id[$i],$prd_del)){ $temp_id[]=$sess_id[$i]; $temp_prdid[]=$sess_prdid[$i]; $temp_name[]=$sess_name[$i]; $temp_price[]=$sess_price[$i]; $temp_img[]=$sess_img[$i]; $temp_num[]=$prd_num[$i]; } } $sess_id=$temp_id; $sess_prdid=$temp_prdid; $sess_name=$temp_name; $sess_price=$temp_price; $sess_img=$temp_img; $sess_num=$temp_num; if($calculate){ print "<meta http-equiv=refresh content=0;url=Cart.php>"; }else if($complete){ print "<meta http-equiv=refresh content=0;url=Order.php>"; }else if($del){ session_destroy(); print "<meta http-equiv=refresh content=0;url=Cart.php>"; }else if($contin){ print "<meta http-equiv=refresh content=0;url=all-prd.php>"; } ?> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> ..................................... ผมต้องแก้อย่างไร ครับ ????? ............................................... โค็ต ก่อหน้านี้ เป็น Cart.php เป็นดังนี้ .... <? session_start(); include "inc/config.inc.php"; $title="select * from title where id=1"; $titlere=mysql_query($title) or die("ERROR $title บรททัด3"); $titler=mysql_fetch_row($titlere); $link="select * from link where id=1"; $linkre=mysql_query($link) or die("ERROR $link บรททัด7"); $linkr=mysql_fetch_row($linkre); $banner="select * from banner where id=1"; $bannerre=mysql_query($banner) or die("ERROR $banner บรททัด10"); $bannerr=mysql_fetch_row($bannerre); $editor="select * from editortalk where id=1"; $editorre=mysql_query($editor) or die("ERROR $editor บรททัด13"); $editorr=mysql_fetch_row($editorre); $bg="select * from bg where id=1"; $bgre=mysql_query($bg) or die("ERROR $bg บรททัด16"); $bgr=mysql_fetch_row($bgre); $shop="select * from shop where id=1"; $shopre=mysql_query($shop) or die("ERROR $shop บรททัด19"); $shopr=mysql_fetch_row($shopre); $sess_id=$_SESSION["sess_id"]; $sess_prdid=$_SESSION["sess_prdid"]; $sess_name=$_SESSION["sess_name"]; $sess_price=$_SESSION["sess_price"]; $sess_img=$_SESSION["sess_img"]; $sess_num=$_SESSION["sess_num"]; ?> <!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" /> <link rel="stylesheet" href="styles.css" type="text/css" /> <meta name="Keywords" content="<?=$titler[3];?>" /> <meta name="Description" content="<?=$shopr[1];?> ตะà¸à¸£à¹‰à¸²à¸ªà¸´à¸™à¸„้า <?=$titler[2];?>" /> <meta name="robots" content="index,follow"> <title>ตะà¸à¸£à¹‰à¸²à¸ªà¸´à¸™à¸„้า <?=$shopr[1];?></title> <style type="text/css"> <!-- a:link { color: #<?=$linkr[1];?>; text-decoration: none; } a:visited { text-decoration: none; color: #<?=$linkr[2];?>; } a:hover { text-decoration: underline; color: #<?=$linkr[3];?>; } a:active { text-decoration: none; color: #<?=$linkr[4];?>; } body { background-color: #<?=$bgr[1];?>; <? if($bgr[2]!=""){ ?>background-image: url(img/<?=$bgr[2];?>); background-repeat: <?=$bgr[3];?>; <? } ?> } --> </style></head> <body> <table width="980" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td bgcolor="#FFFFFF"><table width="980" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><? include "header.php"; ?></td> </tr> <tr> <td><table width="980" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="220" align="center" valign="top"><? include "menu.php"; ?></td> <td width="760" align="center" valign="top"><table width="750" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="img/step1.jpg" /></td> </tr> <tr> <td height="35" background="img/bg-main.jpg"><table width="730" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align="left"><font color="#333333"><strong>ตะà¸à¸£à¹‰à¸²à¸ªà¸´à¸™à¸„้า</strong></font></td> </tr> </table></td> </tr> <tr> <td><table width="750" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td> <form action="basket_cal.php" method="post" name="form1" id="form1"> <font size="3" color="#FF0000"><strong> <? if(count($_SESSION['sess_id'])==0){ print "<br><center>ไม่มีรายà¸à¸²à¸£à¸ªà¸´à¸™à¸„้าในตะà¸à¸£à¹‰à¸²à¸‚à¸à¸‡à¸„ุณครับ</center>"; print "<br><center><input name='contin' type='submit' id='contin' value='เลืà¸à¸à¸‹à¸·à¹‰à¸à¸ªà¸´à¸™à¸„้าต่à¸' /></center>"; }else{ ?> </strong></font> <table width="750" border="0" align="center" cellpadding="0" cellspacing="2" bgcolor="#AFE1EC"> <tr align="center" bgcolor="#0000FF"> <td width="75" height="25" bgcolor="#63C6DB"><font size="2" color="#333333"><strong>เลืà¸à¸à¸¥à¸š</strong></font></td> <td width="450" height="25" bgcolor="#63C6DB"><font size="2" color="#333333"><strong>ชื่à¸à¸ªà¸´à¸™à¸„้า</strong></font></td> <td width="75" height="25" bgcolor="#63C6DB"><font size="2" color="#333333"><strong>จำนวน</strong></font></td> <td width="75" height="25" bgcolor="#63C6DB"><font size="2" color="#333333"><strong>ราคาต่à¸à¸Šà¸´à¹‰à¸™</strong></font></td> <td width="75" height="25" bgcolor="#63C6DB"><font size="2" color="#333333"><strong>รวมเงิน</strong></font></td> </tr> <?php for($i=0;$i<count($sess_id);$i++){ $total_unit=$sess_num[$i]*$sess_price[$i]; $total=$total+$total_unit; ?> <tr align="center"> <td width="75" height="80" bgcolor="#CDEDF3"><input type="checkbox" name="prd_del[]" value="<?php echo $sess_id[$i]; ?>" /></td> <td width="450" height="80" bgcolor="#CDEDF3"><table width="400" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="100" align="center" valign="top"><a href="prd-detail.php?prd_id=<?php echo $sess_id[$i] ?>" title="<?php echo $sess_name[$i] ?>"><img src="s_prd_img/<?php echo $sess_img[$i] ?>" alt="<?php echo $sess_name[$i] ?>" width="75" height="75" border="0" title="<?php echo $sess_name[$i] ?>" /></a></td> <td width="300" align="left" valign="top"><font size="2" color="#333333"><strong>รหัสสินค้า : </strong> <font color="#FF0000"><?php echo $sess_prdid[$i] ?></font> <br /> <strong><img src="img/icon_bullet_go.gif" width="9" height="10" /> ชื่à¸à¸ªà¸´à¸™à¸„้า : </strong> <a href="prd-detail.php?prd_id=<?php echo $sess_id[$i] ?>" title="<?php echo $sess_name[$i] ?>"><?php echo $sess_name[$i] ?></a></font></td> </tr> </table> </td> <td width="75" height="80" bgcolor="#CDEDF3"><input type="text" name="prd_num[]" value="<?php echo $sess_num[$i]; ?>" size="4" style="text-align:center" /></td> <td width="75" height="80" align="right" bgcolor="#CDEDF3"><font size="2" color="#333333"><?php echo $sess_price[$i]; ?> </font></td> <td width="75" height="80" align="right" bgcolor="#CDEDF3"><font size="2" color="#333333"><?php echo $total_unit; ?> </font></td> </tr> <?php }?> </table> <font color="#333333" size="2"> </font> <table width="750" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="30" align="right" bgcolor="#E6F5F9"><font color="#333333" size="2">รวมเป็นเงินทั้งหมด <font color="#FF0000"><strong><? echo "$total"; ?></strong></font> บาท </font></td> </tr> <tr> <td height="10" align="right"></td> </tr> <tr> <td align="right"> <input name="del" type="submit" value="ลบสินค้าในตะà¸à¸£à¹‰à¸²" /> <input name="contin" type="submit" id="contin" value="เลืà¸à¸à¸‹à¸·à¹‰à¸à¸ªà¸´à¸™à¸„้าต่à¸" /> <input type="submit" name="calculate" value="คำนวณใหม่" /> <input type="submit" name="complete" value="สั่งซื้à¸à¸ªà¸´à¸™à¸„้า" /></td> </tr> </table> </form> <? } ?></td> </tr> <tr> <td> </td> </tr> </table></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td <? if($bannerr[2]!=""){ ?>background="img/<?=$bannerr[2];?>"<? } if($bannerr[3]!=""){ ?>bgcolor="#<?=$bannerr[3];?>"<? } ?>><? include "footer.php"; ?></td> </tr> </table></td> </tr> </table> </body> </html> .............................. ไฟล์ตัวนี้ใช้งานผ่านแต่เมื่อวิ่งเข้าตัวบนแล้ว หน้าขาวเลย ครับ :wanwan017:ใครเก่งช่วยด้วยครับ หัวข้อ: Re: ช่วยด้วยครับ เรื่อง ระบบตะกร้าครับ หน้าขาว เริ่มหัวข้อโดย: goldxp ที่ 03 ธันวาคม 2013, 05:20:39 สร้างไฟล์ .htaccess ดูนะครับ
พิมพข้อมูลตามนี้บันทึกไว้ที่ web root folder ครับจะแสดง error ขึ้นหน้าเว็บให้เห็นครับ php_flag display_errors On php_flag display_startup_errors On php_value error_reporting -1 หรือตั้งค่าที่ไฟล์ config.inc.php ก็ได้ครับ error_reporting(-1);//ถ้าดูที่ binary ปกติจะหมายถึงค่า 111111 ทุกตัว ini_set('display_errors',1); แต่การตั้งค่า display_errors ที่โค้ด php จะไม่แสดงผล fatal error บางอย่างเช่น parse error และ compile error ครับ |