ยินดีต้อนรับคุณ, บุคคลทั่วไป กรุณา เข้าสู่ระบบ หรือ ลงทะเบียน

เข้าสู่ระบบด้วยชื่อผู้ใช้ รหัสผ่าน และระยะเวลาในเซสชั่น

ThaiSEOBoard.comพัฒนาเว็บไซต์Programmingช่วยด้วยครับ เรื่อง ระบบตะกร้าครับ หน้าขาว
หน้า: [1]   ลงล่าง
พิมพ์
ผู้เขียน หัวข้อ: ช่วยด้วยครับ เรื่อง ระบบตะกร้าครับ หน้าขาว  (อ่าน 529 ครั้ง)
0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้
kangpla
Newbie
*

พลังน้ำใจ: 1
ออฟไลน์ ออฟไลน์

กระทู้: 30



ดูรายละเอียด
« เมื่อ: 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" />


.....................................
ผมต้องแก้อย่างไร ครับ
Huh???
...............................................
โค็ต ก่อหน้านี้ เป็น 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]; ?>&nbsp;&nbsp;</font></td>
                              <td width="75" height="80" align="right" bgcolor="#CDEDF3"><font size="2" color="#333333"><?php echo $total_unit; ?>&nbsp;&nbsp;</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> บาท&nbsp;&nbsp;&nbsp;</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>&nbsp;</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:ใครเก่งช่วยด้วยครับ



บันทึกการเข้า
goldxp
สมุนแก๊งเสียว
*

พลังน้ำใจ: 73
ออฟไลน์ ออฟไลน์

กระทู้: 557



ดูรายละเอียด เว็บไซต์
« ตอบ #1 เมื่อ: 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 ครับ
บันทึกการเข้า

หน้า: [1]   ขึ้นบน
พิมพ์