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,028

HOME > PHP > PHP Forum > รบกวนถามเรื่อง เกี่ยวกับระบบสมัครสมาชิกค่าที่ส่งมาจากฟอร์มมันไม่มาที่หน้าบบันทึก ผู้รู้ช่วยตอบหน่อยครับ



 

รบกวนถามเรื่อง เกี่ยวกับระบบสมัครสมาชิกค่าที่ส่งมาจากฟอร์มมันไม่มาที่หน้าบบันทึก ผู้รู้ช่วยตอบหน่อยครับ

 



Topic : 091439

Guest




คือว่าสามารถเชื่อมต่อและอัพได้ แต่ค่าที่ลงไปในดาต้าเบสเป็นค่าป่าวๆๆ
ตัวอย่างโค้ดครับ
ในส่วนฟอร์มครับ

Code (PHP)
<!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>
<?php
include_once"connectmem.php";
?>
<style type="text/css">
<!--
#form1 {
	color: #F00;
}
.a {
	color: #F00;
}
.a {
	color: #F00;
}
.a {
	color: #F00;
}
.a {
	font-family: Arial, Helvetica, sans-serif;
}
.n {
	color: #0B7300;
}
.n {
	font-weight: bold;
}
.m {
	font-weight: normal;
}
.m {
	color: #0B7300;
}
a:link {
	text-decoration: none;
	color: #FFF;
}
a:visited {
	text-decoration: none;
	color: #F90;
}
a:hover {
	text-decoration: none;
	color: #FFF;
}
a:active {
	text-decoration: none;
	color: #0B7300;
}
-->
</style>
</head>

<body text="#FFFFFF" link="#FF9933" vlink="#FFFFFF" alink="#0B7300">
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td colspan="2" bgcolor="#FFFFFF">::</td>
  </tr>
  <tr>
    <td width="76">&nbsp;</td>
    <td width="424">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="2"><img src="image/memhead.jpg" width="500" height="40" /></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td align="left" bgcolor="#CCCCCC" class="m">&nbsp;ชื่อ-สกุล</td>
    <td bgcolor="#CCCCCC"> <form id="form1" name="form1" method="POST" action="savemem.php">
       <input name="txtname" type="text" id="txtname" size="30" maxlength="30" />
      <span id="form1">* </span>
    </form></td>
  </tr>
  <tr>
    <td align="left" bgcolor="#CCCCCC" class="m">&nbsp;ที่อยู่</td>
    <td bgcolor="#CCCCCC"><form id="form2" name="form2" method="POST" action="savemem.php">
      <textarea name="address" id="address" cols="45" rows="6"></textarea>
    </form></td>
  </tr>
  <tr>
    <td align="left" bgcolor="#CCCCCC" class="m">&nbsp;ชื่อผู้ใช้</td>
    <td bgcolor="#CCCCCC"><input name="usertxt" type="text" id="usertxt" size="30" maxlength="20" />
    &nbsp; <span class="a">*</span></td>
  </tr>
  <tr>
    <td align="left" bgcolor="#CCCCCC" class="m">&nbsp;รหัสผ่าน</td>
    <td bgcolor="#CCCCCC"><form id="form3" name="form3" method="POST" action="savemem.php">
      <input name="pass1" type="password" id="pass1" maxlength="8" />
      <span class="a">*</span>
    </form></td>
  </tr>
  <tr>
    <td align="left" bgcolor="#CCCCCC" class="m">&nbsp;รีรหัสผ่าน</td>
    <td bgcolor="#CCCCCC"><form id="form4" name="form4" method="POST" action="savemem.php">
      <input name="pass2" type="password" id="pass2" maxlength="8" />
      <span class="a">*</span>
    </form></td>
  </tr>
  <tr>
    <td align="left" bgcolor="#CCCCCC" class="m">&nbsp;อีเมล</td>
    <td bgcolor="#CCCCCC"><form id="form5" name="form5" method="POST" action="savemem.php">
      <input name="mail" type="text" id="mail" size="30" maxlength="20" />
    </form></td>
  </tr>
  <tr>
    <td bgcolor="#CCCCCC" class="m">&nbsp;เพศ</td>
    <td bgcolor="#CCCCCC"><form id="form6" name="form6" method="GET" action="savemem.php">
      <input name="radio" type="radio" id="radio" value="radio" checked="checked" />
    ชาย&nbsp;&nbsp;&nbsp;&nbsp;
    <input name="radio2" type="radio" id="radio2" value="radio2" />
    หญิง
    </form></td>
  </tr>
  <tr>
    <td bgcolor="#CCCCCC">&nbsp;</td>
    <td bgcolor="#CCCCCC">&nbsp;</td>
  </tr>
  <tr>
    <td bgcolor="#CCCCCC">&nbsp;</td>
    <td bgcolor="#CCCCCC">&nbsp;</td>
  </tr>
  <tr>
    <td bgcolor="#CCCCCC">&nbsp;</td>
    <td bgcolor="#CCCCCC">&nbsp;</td>
  </tr>
  <tr>
    <td bgcolor="#CCCCCC">&nbsp;</td>
    <td bgcolor="#CCCCCC"><form id="form7" name="form7" method="POST" action="savemem.php">
      <input type="submit" name="button1" id="button1" value="Submit" />
    &nbsp;
    <input type="reset" name="button2" id="button2" value="Reset" />
    </form></td>
  </tr>
  <tr>
    <td bgcolor="#CCCCCC">&nbsp;</td>
    <td bgcolor="#CCCCCC">&nbsp;</td>
  </tr>
  <tr>
    <td bgcolor="#CCCCCC">&nbsp;</td>
    <td bgcolor="#CCCCCC">&nbsp;</td>
  </tr>
  <tr>
    <td bgcolor="#009900">&nbsp;</td>
    <td bgcolor="#009900"><a href="jumlonghome.php">::HOME::</a></td>
  </tr>
</table>
</body>
</html>


ในส่วนหน้าบันทึกครับ ชื่อไฟล์

Code (PHP)
<meta charset ="UTF-8">
<?php
include_once"connectmem.php";
$name = $_POST['txtname'];
$address = $_POST['address'];
$user = $_POST['usertxt'];
$pass = $_POST['pass1'];
//$pass2 = $_POST['pass2'];
$mailto = $_POST['mail'];
//$sex1 = $_GET['radio'];
//$sex2 = $_GET['radio2'];
$mysql = "INSERT INTO member(mem_name,mem_address,mem_user,mem_pass,mem_email)VALUES('$name','$address','$user','$pass','$mailto')";
$cc = mysql_query($mysql);
if($cc){
	echo "บันทึกข้อมูลเรียบร้อย";
	//echo "hello".$name;     ตรงนี้ทดลองปริ้นค่าที่ส่งมาขึ้นแค่คำว่า hello
	}
	else{
		echo mysql_error();
		}
?>




ผู้รู้ช่วยตอบด้วยครับ ขอบคุณครับ



Tag : PHP







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2013-02-25 21:46:35 By : เทส View : 586 Reply : 2
 

 

No. 1



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

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

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

Quote:
$cc = mysql_query($mysql);


Code (PHP)
$cc = mysql_query($mysql) or die(mysql_error());


เอา Error มาดูหน่อยครับ






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-02-26 05:49:07 By : mr.win
 


 

No. 2



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



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


ผมคิดว่า ตรงฟอร์มรับค่า ควรจะมีแค่ ค่าเดียวนะครับ คุณแบ่งฟอร์มหลายๆ ฟอร์ม เวลากดคลิกส่งบรรทัดที่ 136 มันก็จะไม่มีค่าส่งมาครับ
ลองทำแบบนี้นะ

Code (PHP)
<form id="form1" name="form1" method="POST" action="savemem.php"> 
<label>ชื่อ-สกุล</label>
<input name="txtname" type="text" class="my_date" size="10" />
<label>ที่อยู่</label>
<input name="address" type="text" class="my_date" size="10" />
<label>ชื่อผู้ใช้</label>
<input type="text" name"usertxt" >
<input type="submit" name="Search" value="Search" />
</form>


ลองตามนี้ดูครับ ฟอร์มส่งค่า น่าจะมีแค่ฟอร์มเดียวครับ ลองดูครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-02-28 18:19:51 By : theyounggun
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
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 อัตราราคา คลิกที่นี่