Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > PHP > PHP Forum > กด Next แล้วมันไม่ไปอะครับ ตอนกดบน host นะ ในเครื่องไป



 

กด Next แล้วมันไม่ไปอะครับ ตอนกดบน host นะ ในเครื่องไป

 



Topic : 064519



โพสกระทู้ ( 254 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook



Code (PHP)
<?
ob_start();
//============ Start Session และทำการเรียก Function ติดต่อฐานข้อมูล 
session_start();
require("connect/connect.php");
require("connect/function.php");
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<title>::: www.beautifulshop-dress.com :::</title>
<link href="css/styles.css" rel="stylesheet" type="text/css">
</head>
<body topmargin="0" background="image/z06.jpg">
<table width="778" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
  <tr> 
    <td bgcolor="#FFFFFF"> <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td>
            <?php require_once('head.php'); ?>
          </td>
        </tr>
        <tr> 
          <td><table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#f2f2f6" bgcolor="#FFFFFF">
              <tr> 
                <td width="15%" valign="top"> <?php require_once('menuleft.php'); ?> <br> </td>
                <td width="69%" valign="top"> 
                  <table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <!--DWLayoutTable-->
                    <tr> 
                      <td width="100%" height="703" valign="top"> 
                        <table width="100%" height="448" border="0" align="center" background="image/z06.jpg">
                          <tr valign="top"> 
                            <td><strong> </strong> 
                              <table width="100%" height="30" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01">
                                <tr> 
                                  <td width="100%" background="image/menu02.jpg"><div align="center"><strong> 
                                      <? 
							  //============ เลือกว่าเป็นหมวดอะไร
$resultHeadPro=select("category","where 1=1 and CatID='".$_GET["CatID"]."'");
if(!$resultHeadPro)
{
//header("location:index.php");
}
if($_GET["CatID"]!="")
{
echo "(".$resultHeadPro["CategoryName"].")";
}
else
{
echo "(แสดงทั้งหมด)";
}
?>
                                      </strong> </div></td>
                                  
                                </tr>
                              </table>
                            </td>
                          </tr>
                          <tr> 
                            <td><?

//============ เลือกรายการสินค้าออกมาแสดง
$condition="";
if($_GET["CatID"] <> "")
{
$condition="and CatID='$_GET[CatID]' ";
}						


echo"<table align=center><tr>";

		
$sql = "select * from product  where 1=1 $condition ";
/*   ตั้งค่า แสดงผลต่อหน้า  $Per_Page   */

$Per_Page =60;
if(!$Page)
$Page=1;

//============  คำนวณจำนวนหน้า
$Prev_Page = $Page-1;
$Next_Page   = $Page+1;

$result=mysql_query($sql);
$Page_start = ($Per_Page*$Page)-$Per_Page;
$Num_Rows = mysql_num_rows($result);

if($Num_Rows<=$Per_Page)
		$Num_Pages =1;
else if(($Num_Rows % $Per_Page)==0)
		$Num_Pages =($Num_Rows/$Per_Page)	;
else 
		$Num_Pages =($Num_Rows/$Per_Page)	+1;

$Num_Pages  = (int)$Num_Pages;

if(($Page>$Num_Pages)	|| ($Page<0))
print "<center><b>จำนวน $Page มากกว่า $Num_Pages ยังไม่มีข้อความ<b></center>";
$sql .= "  order by ProductID DESC 	LIMIT $Page_start , $Per_Page";
  //ส่วนแสดงผล
$i=0;
		$query =  mysql_query($sql);
		While($resutNewPro= mysql_fetch_array($query)){

$i++;
echo "<td>";
?>
                              <table width="120" height="105" border="1" cellpadding="3" cellspacing="0" align="center"  background="image/z06.jpg">
                                <tr>
                                  <td height="60" valign="top" bgcolor="#FFCCFF"><div align="center"><a href="detail.php?CatID=<?=$resutNewPro["CatID"];?>&ProductID=<?=$resutNewPro["ProductID"];?>"><img src="picture/<?=$resutNewPro["Picture"];?>" width="150" height="170" border="0"></a></div></td>
                                </tr>
                                <tr>
                                  <td valign="top" bgcolor="#FFFF33"><div align="center"> <a href="detail.php?CatID=<?=$resutNewPro["CatID"];?>&ProductID=<?=$resutNewPro["ProductID"];?>">
                                      <?=$resutNewPro["ProductName"];?>
                                      </a><br>
                                    ปกติ
                                    <?="(<s>".number_format($resutNewPro["PriceNormal"], 2,'.',',')."</s>";?>
                                    บาท) <br>
                                    <font color="#FF0000"><strong>พิเศษ</strong></font>
                                    <?="(".number_format($resutNewPro["Price"], 2,'.',',');?>
                                    บาท)<br>
                                    ค่าจัดส่ง
                                    <?="(".number_format($resutNewPro["PriceSend"], 2,'.',',');?>
                                    บาท)</div></td>
                                </tr>
                              </table>
                              <?
	//============ แสดงแถวละ 4
													echo"</td>";
									if(($i)%4==0)
									{
									echo"</tr>";
									}
									else
									{
									echo "<td>";
										}							  
}
echo"</tr></table>";

if($i==0)
{
echo "<strong><center><font color=red>ไม่มีรายการสินค้า</font></center></strong>";
}
?>
                              <hr width="98%" color="#f2f2f6">
                              <table width="100%" align="center" cellpadding="0" cellspacing="0">
                                <tr>
                                  <td width="100%" colspan="10" class="boxtext"><div align="center">จำนวน
                                    <?=$Page;?>
                                    หน้า <b>
                                      <?=$Num_Pages;?>
                                      </b> (
                                    <?= $Num_Rows;?>
                                    รายการ) </div></td>
                                </tr>
                              </table>
                              <table width="100%" border="0" cellpadding="1" cellspacing="1" align="center">
                                <tr>
                                  <td><div align="center">
                                    <?/* สร้างปุ่มย้อนกลับ */
			if($Prev_Page)	
					echo " <a href='$PHP_SELF?Page=$Prev_Page&CatID=$_GET[CatID]' class='boxtext'><< Back </a> ";
			for($i=1; $i<$Num_Pages; $i++){
						if($i != $Page)
								echo " [ <a href='$PHP_SELF?Page=$i&CatID=$_GET[CatID]' class='boxtext'>$i</a> ]";
						else 
								echo "<b> $i </b>";
		}
/*สร้างปุ่มเดินหน้า */
if($Page!=$Num_Pages)
					echo " <a href ='$PHP_SELF?Page=$Next_Page&CatID=$_GET[CatID]' class='boxtext'> Next >>  </a>";
			
			?>
                                  </div></td>
                                </tr>
                              </table></td>
                          </tr>
                          <tr> 
                            <td width="100%" height="16" align="center">&nbsp;</td>
                          </tr>
                        </table>
                      </p></td>
                    </tr>
                </table></td>
                <td width="16%" valign="top"> <?php require_once('menuright.php'); ?> </td>
              </tr>
              <tr> 
                <td colspan="3" valign="top">
                  <?php require_once('down.php'); ?>
                </td>
              </tr>
            </table></td>
        </tr>
      </table></td>
  </tr>
</table>
</body>
</html>





Tag : PHP, CakePHP







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2011-08-09 23:09:07 By : tormam View : 855 Reply : 9
 

 

No. 1



โพสกระทู้ ( 254 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

คือว่าตอนนี้มันกด Next ที่บน Host จริง มันไม่ไปหน้าต่อไปครับ มันเข้ามาหน้าเดิม แต่ตอนลองใน localhost มันได้นะครับ






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-08-09 23:16:56 By : tormam
 


 

No. 2



โพสกระทู้ ( 254 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

ตอนนี้ผมลอง echo $sql; จากบรรทัด 99 มันบอกแบบนี้

select * from product where 1=1 ORDER BY ProductID DESC LIMIT 0 , 60

ตอนนี้ รูปมี 62 รูป คับ แต่กดไม่ไป
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-08-09 23:41:25 By : tormam
 

 

No. 3

Guest


ลอง echo ค่า $PHP_SELF ออกมาดูสิครับ ว่ามีค่าหรือเปล่า
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-08-09 23:44:22 By : nobuts
 


 

No. 4



โพสกระทู้ ( 254 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

select * from product where 1=1 ORDER BY ProductID DESC LIMIT 0 , 60

ออกมาแบบนี้
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-08-10 14:33:01 By : tormam
 


 

No. 5



โพสกระทู้ ( 11,835 )
บทความ ( 10 )

สมาชิกที่ใส่เสื้อไทยครีเอท Hall of Fame 2012

สถานะออฟไลน์


if(!$_GET['Page'])
$Page=1;
else
$Page=$_GET['Page'];
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-08-10 14:44:28 By : ikikkok
 


 

No. 6



โพสกระทู้ ( 254 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

PlaKriM พี่คับ อธิ บาย ที่ คือว่าต้องทำไง
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-08-10 15:09:00 By : tormam
 


 

No. 7



โพสกระทู้ ( 254 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

ต้องเอาไว้หรือแก้ บรร ทัดไหน
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-08-10 15:33:10 By : tormam
 


 

No. 8



โพสกระทู้ ( 11,835 )
บทความ ( 10 )

สมาชิกที่ใส่เสื้อไทยครีเอท Hall of Fame 2012

สถานะออฟไลน์


Quote:
$Per_Page =60;
if(!$Page)
$Page=1;


ตรงนี้ครับ ลองแก้เป็นแบบที่ผมบอก ไม่งั้นก็ลอง echo $Page ออกมาดูก่อนได้ครับว่ามันมีค่าเป็น 2 บ้างไหมถ้าคลิกที่ Page 2
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-08-10 15:33:31 By : ikikkok
 


 

No. 9



โพสกระทู้ ( 254 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

ครับ กดไปแล้วครับ ว่าแต่ถ้าผมต้องการให้มัน เป็นหน้าออกมาแบบ <<<Back [1][2][3]....[50] Next >>> ไม่ทราบว่าต้องแก้หรือเพิ่ม อะไรไหมครับ ผม ลอง เอาจาก ลิงค์ นี้มา ยำแล้ว มันไม่ได้ https://www.thaicreate.com/community/php-mysql-pagination.html
โค้ด ตอนนี้
Code (PHP)
<?
ob_start();
//============ Start Session และทำการเรียก Function ติดต่อฐานข้อมูล 
session_start();
require("connect/connect.php");
require("connect/function.php");
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<title>::: www.beautifulshop-dress.com :::</title>
<link href="css/styles.css" rel="stylesheet" type="text/css">
</head>
<body topmargin="0" background="image/z06.jpg">
<table width="778" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
  <tr> 
    <td bgcolor="#FFFFFF"> <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td>
            <?php require_once('head.php'); ?>
          </td>
        </tr>
        <tr> 
          <td><table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#f2f2f6" bgcolor="#FFFFFF">
              <tr> 
                <td width="15%" valign="top"> <?php require_once('menuleft.php'); ?> <br> </td>
                <td width="69%" valign="top"> 
                  <table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <!--DWLayoutTable-->
                    <tr> 
                      <td width="100%" height="703" valign="top"> 
                        <table width="100%" height="448" border="0" align="center" background="image/z06.jpg">
                          <tr valign="top"> 
                            <td><strong> </strong> 
                              <table width="100%" height="30" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01">
                                <tr> 
                                  <td width="100%" background="image/menu02.jpg"><div align="center"><strong> 
                                      <? 
							  //============ เลือกว่าเป็นหมวดอะไร
$resultHeadPro=select("category","where 1=1 and CatID='".$_GET["CatID"]."'");
if(!$resultHeadPro)
{
//header("location:index.php");
}
if($_GET["CatID"]!="")
{
echo "(".$resultHeadPro["CategoryName"].")";
}
else
{
echo "(แสดงทั้งหมด)";
}
?>
                                      </strong> </div></td>
                                  
                                </tr>
                              </table>
                            </td>
                          </tr>
                          <tr> 
                            <td><?

//============ เลือกรายการสินค้าออกมาแสดง
$condition="";
if($_GET["CatID"] <> "")
{
$condition="and CatID='$_GET[CatID]' ";
}						


echo"<table align=center><tr>";

		
$sql = "select * from product  where 1=1 $condition ";
/*   ตั้งค่า แสดงผลต่อหน้า  $Per_Page   */

$Per_Page =60;
if(!$_GET['Page'])
$Page=1;
else
$Page=$_GET['Page'];

//============  คำนวณจำนวนหน้า
$Prev_Page = $Page-1;
$Next_Page   = $Page+1;

$result=mysql_query($sql);
$Page_start = ($Per_Page*$Page)-$Per_Page;
$Num_Rows = mysql_num_rows($result);

if($Num_Rows<=$Per_Page)
		$Num_Pages =1;
else if(($Num_Rows % $Per_Page)==0)
		$Num_Pages =($Num_Rows/$Per_Page)	;
else 
		$Num_Pages =($Num_Rows/$Per_Page)	+1;

$Num_Pages  = (int)$Num_Pages;

if(($Page>$Num_Pages)	|| ($Page<0))
print "<center><b>จำนวน $Page มากกว่า $Num_Pages ยังไม่มีข้อความ<b></center>";
$sql .= " ORDER BY ProductID DESC 	LIMIT $Page_start , $Per_Page";
  //ส่วนแสดงผล
$i=0;
		$query =  mysql_query($sql);
		While($resutNewPro= mysql_fetch_array($query)){

$i++;
echo "<td>";
?>
                              <table width="120" height="105" border="1" cellpadding="3" cellspacing="0" align="center"  background="image/z06.jpg">
                                <tr>
                                  <td height="60" valign="top" bgcolor="#FFCCFF"><div align="center"><a href="detail.php?CatID=<?=$resutNewPro["CatID"];?>&ProductID=<?=$resutNewPro["ProductID"];?>"><img src="picture/<?=$resutNewPro["Picture"];?>" width="150" height="170" border="0"></a></div></td>
                                </tr>
                                <tr>
                                  <td valign="top" bgcolor="#FFFF33"><div align="center"> <a href="detail.php?CatID=<?=$resutNewPro["CatID"];?>&ProductID=<?=$resutNewPro["ProductID"];?>">
                                      <?=$resutNewPro["ProductName"];?>
                                      </a><br>
                                    ปกติ
                                    <?="(<s>".number_format($resutNewPro["PriceNormal"], 2,'.',',')."</s>";?>
                                    บาท) <br>
                                    <font color="#FF0000"><strong>พิเศษ</strong></font>
                                    <?="(".number_format($resutNewPro["Price"], 2,'.',',');?>
                                    บาท)<br>
                                    ค่าจัดส่ง
                                    <?="(".number_format($resutNewPro["PriceSend"], 2,'.',',');?>
                                    บาท)</div></td>
                                </tr>
                              </table>
                              <?
	//============ แสดงแถวละ 4
													echo"</td>";
									if(($i)%4==0)
									{
									echo"</tr>";
									}
									else
									{
									echo "<td>";
										}							  
}
echo"</tr></table>";

if($i==0)
{
echo "<strong><center><font color=red>ไม่มีรายการสินค้า</font></center></strong>";
}
?>
                              <hr width="98%" color="#f2f2f6">
                              <table width="100%" align="center" cellpadding="0" cellspacing="0">
                                <tr>
                                  <td width="100%" colspan="10" class="boxtext"><div align="center">จำนวน
                                    <?=$Page;?>
                                    หน้า <b>
                                      <?=$Num_Pages;?>
                                      </b> (
                                    <?= $Num_Rows;?>
                                    รายการ) </div></td>
                                </tr>
                              </table>
                              <table width="100%" border="0" cellpadding="1" cellspacing="1" align="center">
                                <tr>
                                  <td><div align="center">
                                    <?/* สร้างปุ่มย้อนกลับ */
			if($Prev_Page)	
					echo " <a href='$PHP_SELF?Page=$Prev_Page&CatID=$_GET[CatID]' class='boxtext'><< Back </a> ";
			for($i=1; $i<$Num_Pages; $i++){
						if($i != $Page)
								echo " [ <a href='$PHP_SELF?Page=$i&CatID=$_GET[CatID]' class='boxtext'>$i</a> ]";
						else 
								echo "<b> $i </b>";
		}
/*สร้างปุ่มเดินหน้า */
if($Page!=$Num_Pages)
					echo " <a href ='$PHP_SELF?Page=$Next_Page&CatID=$_GET[CatID]' class='boxtext'> Next >>  </a>";
			
			?>
                                  </div></td>
                                </tr>
                              </table></td>
                          </tr>
                          <tr> 
                            <td width="100%" height="16" align="center">&nbsp;</td>
                          </tr>
                        </table>
                      </p></td>
                    </tr>
                </table></td>
                <td width="16%" valign="top"> <?php require_once('menuright.php'); ?> </td>
              </tr>
              <tr> 
                <td colspan="3" valign="top">
                  <?php require_once('down.php'); ?>
                </td>
              </tr>
            </table></td>
        </tr>
      </table></td>
  </tr>
</table>
</body>
</html>


แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-08-10 15:51:07 By : tormam
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : กด Next แล้วมันไม่ไปอะครับ ตอนกดบน host นะ ในเครื่องไป
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 01
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่