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 > ช่วยดูโค้ดให้หน่อยครับ ว่ามันผิดยังไง ควรแก้ยังไงครับ



 

ช่วยดูโค้ดให้หน่อยครับ ว่ามันผิดยังไง ควรแก้ยังไงครับ

 



Topic : 081610



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



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




หน้า checklogin
<?
session_start();
$user1=$_POST[username];
$pass=$_POST[password];
include('connect.php');
//echo $user1,$pass;

$sql="select * from member where mem_name='$user1' and mem_password='$pass' ";
mysql_query("SET NAMES 	utf8");
$result=mysql_db_query($db,$sql);

$row=mysql_fetch_array($result);
$num=mysql_num_rows($result); // ?????????????????????????????

$cookie_id="id";//????????? cookie

    if ($num>0){//????????????????
	     $_SESSION['id']=$row[mem_ID]; //??????????
         echo " <meta http-equiv='refresh' content='0;url=showmem.php'>";  //?????????????menuleft.php
	}else{//???????
         echo"<script>alert('not')</script>"; //??? massagebox
	     echo " <meta http-equiv='refresh' content='0;url=login.php'>"; //?????????????menuleft.php
    }	
?>


error หน้า checkloginครับ

อันนี้หน้า showmem ครับ
<?php session_start();?>
<!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" />
<title>Untitled Document</title>
<style type="text/css">
<!--
body {
	background-image: url(images/crop-13177241270092.jpg);
	margin-top: 60px;
	margin-left: 227px;
}
body,td,th {
	color: #E2B61D;
}
-->
</style></head>

<body>

<form id="form1" name="form1" method="post" action="">
	
  <table width="100" border="0">
   <?php
            include('connect.php');
			$memid=$_SESSION['mem_ID'];
			$sql="select * from member where mem_ID='$memid' ";
			mysql_query("SET NAMES utf8");
			$result=mysql_db_query($db,$sql);
			$row=mysql_fetch_array($result);
			?>
    <tr>
      <td colspan="2"><img src="images/head1.jpg" width="955" height="155" /></td>
    </tr>
    <tr bgcolor="#1B1B1B">
      <td colspan="2" bgcolor="#1B1B1B">
        <link rel="stylesheet" href="menu3_files/css3menu1/style.css" type="text/css" /><style>._css3m{display:none}</style>
        <ul id="css3menu1" class="topmenu">
          <li class="topfirst"><a href="#" style="height:19px;line-height:19px;"><img src="menu3_files/css3menu1/blue-home.png" alt=""/>หน้าแรก</a></li>
          <li class="topmenu"><a href="#" style="height:19px;line-height:19px;"><span>พยากรณ์อากาศ</span></a>
            <ul>
              <li class="subfirst"><a href="http://www.rtnmet.org/weather_24hour.php" target="_top">อากาศวันนี้-กรมอุทกศาสตร์</a></li>
              <li><a href="http://www.tmd.go.th/thailand.php">อากาศวันนี้-กรมอุตุนิยมวิทยา</a></li>
              <li><a href="http://www.tmd.go.th/7-day_forecast.php">อากาศ 7 วัน-กรมอุตุนิยมวิทยา</a></li>
              <li><a href="http://www.windguru.cz/int/index.php?sc=273">พยากรณ์ลม-Windguru</a></li>
          </ul></li>
          <li class="topmenu"><a href="#" style="height:19px;line-height:19px;">ติดต่อเรา</a></li>
          <li class="topmenu"><a href="#" style="height:19px;line-height:19px;">ลิ้ง</a></li>
          <li class="topmenu"><a href="logout.php" style="height:19px;line-height:19px;">Logout</a></li>
          <li class="toplast"><a href="register.php" style="height:19px;line-height:19px;">+</a></li>
  </ul><p class="_css3m"><a href="http://css3menu.com/">Menu Using CSS3 Css3Menu.com</a></p>
      &nbsp;</td>
    </tr>
    <tr>
      <td width="197" height="345">
      <link rel="stylesheet" href="listmenu.css3-2prj_files/css3menu1/style.css" type="text/css" /><style>._css3m{display:none}</style>
      <ul id="css3menu1" class="topmenu">
	<li class="topfirst"><a href="#" style="width:94px;"><span><img src="listmenu.css3-2prj_files/css3menu1/blue-arrow3 right.png" alt=""/>กระทู้</span></a>
	<ul>
		<li class="subfirst"><a href="#">กระทู้ของท่าน</a></li>
		<li><a href="#">สร้างกระทู้</a></li>
	</ul></li>
	<li class="topmenu"><a href="#" style="width:94px;"><span><img src="listmenu.css3-2prj_files/css3menu1/blue-arrow3 right1.png" alt=""/>ข้อมูลส่วนตัว</span></a>
	<ul>
		<li class="subfirst"><a href="showmem.php">ดูข้อมูลส่วนตัว</a></li>
		<li><a href="editmem.php">แก้ไขข้อมูลส่วนตัว</a></li>
	</ul></li>
	<li class="toplast"><a href="#" style="width:94px;"><span><img src="listmenu.css3-2prj_files/css3menu1/blue-arrow3 right2.png" alt=""/>เพื่อน</span></a>
	<ul>
		<li class="subfirst"><a href="#">รายชื่อเพื่อน</a></li>
		<li><a href="#">คำร้องขอเป็นเพื่อน</a></li>
	</ul></li>
</ul>
      <p class="_css3m"><a href="http://css3menu.com/">Menu Using CSS3 Css3Menu.com</a></p>
      <p class="_css3m">&nbsp;</p>

      &nbsp;<a href="https://www.facebook.com/pages/Fishing-House/175007472632984"><img src="images/facebook.gif" width="130" height="32" /></a></td>
      <td width="754" bgcolor="#030303"><table width="381" height="293" border="0" align="center">
        <tr>
           
          <td colspan="2" align="center"><h1><strong>::ข้อมูลสมาชิก</strong>::</h1></td>
          </tr>
        <tr>
          <td width="181" align="right"><strong>ชื่อ:</strong></td>
          <td width="190"><span class="style3 style3"><?  echo $row[mem_name]?>&nbsp;</span></td>
        </tr>
        <tr>
          <td align="right"><strong>รูปประจำตัว (display):</strong></td>
          <td><span class="style3 style3"><?  echo $row[mem_display]?>&nbsp;</span></td>
        </tr>
        <tr>
          <td align="right"><strong>คันเบ๊ด (Rod):</strong></td>
          <td><span class="style3 style3"><?  echo $row[mem_rod]?>&nbsp;</span></td>
        </tr>
        <tr>
          <td height="36" align="right"><strong>รอก (Reel):</strong></td>
          <td><span class="style3 style3"><?  echo $row[mem_reel]?>&nbsp;</span></td>
        </tr>
        <tr>
          <td align="right"><strong>อื่นๆ (other):</strong></td>
          <td><span class="style3 style3"><?  echo $row[mem_other]?>&nbsp;</span></td>
        </tr>
        <tr>
          <td colspan="2" align="center"><strong><a href="editmem.php">แก้ไขข้อมูล</a></strong></td>
          </tr>
      </table></td>
    </tr>
    <tr bgcolor="#1B1B1B">
      <td colspan="2">  
      <div align="center"><strong>Fishing House© 2012 </strong></div></td>
    </tr>
  </table>
</form>
</body>
</html>



หน้า showmem อย่างรู้ว่าเขียน code ถูกหรือเปล่าครับ



Tag : PHP







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2012-07-26 23:26:48 By : thisbank View : 942 Reply : 1
 

 

No. 1



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

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

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

Quote:
$result=mysql_db_query($db,$sql);


แก้เป็น

Code (PHP)
$result=mysql_query($sql) or die(mysql_error());







แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-07-27 05:36:17 By : mr.win
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : ช่วยดูโค้ดให้หน่อยครับ ว่ามันผิดยังไง ควรแก้ยังไงครับ
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ 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 อัตราราคา คลิกที่นี่