|
|
|
ช่วยทีค้าบบ ผมต้องการลบบางอย่างออกจากโค๊ดรบกวนพี่ๆผู้รู้แนะนำทีค้าบบบ |
|
|
|
|
|
|
|
นี่โค๊ดคับ
Code (PHP)
<?php require_once('Connections/member.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "frm_insertmember")) {
$insertSQL = sprintf("INSERT INTO tbl_member (MId, MPass, MName, MLastname, MDate, MMonth, MYear, MSex, MAddress, MEmail) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['MId'], "text"),
GetSQLValueString($_POST['MPass'], "text"),
GetSQLValueString($_POST['MName'], "text"),
GetSQLValueString($_POST['MLastname'], "text"),
GetSQLValueString($_POST['MDate'], "text"),
GetSQLValueString($_POST['MMonth'], "text"),
GetSQLValueString($_POST['MYear'], "text"),
GetSQLValueString(isset($_POST['MSex']) ? "true" : "", "defined","'Y'","'N'"),
GetSQLValueString($_POST['MAddress'], "text"),
GetSQLValueString($_POST['MEmail'], "text"));
mysql_select_db($database_member, $member);
$Result1 = mysql_query($insertSQL, $member) or die("Sorry,Username is used please change");
$insertGoTo = "complete.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
mysql_select_db($database_member, $member);
$query_member = "SELECT * FROM tbl_member";
$member = mysql_query($query_member, $member) or die(mysql_error());
$row_member = mysql_fetch_assoc($member);
$totalRows_member = mysql_num_rows($member);
?>
คือผมต้องการเอาในช่องที่วงไว้ออกอะคับ แต่พอเอาออกแล้ว มันจะสมัครสมาชิกไม่ได้เลย ผมอยากรู้ว่าต้องแก้ยังไงที่จะเอาออกแล้วสมัครสมาชิกได้อ่าคับ ช่วยผมทีคับพี่ๆ
Tag : PHP
|
|
|
|
|
|
Date :
2013-03-07 14:28:51 |
By :
bmza9999 |
View :
2621 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "frm_insertmember")) {
$insertSQL = sprintf("INSERT INTO tbl_member (MId, MPass, MName, MLastname, MSex, MAddress, MEmail) VALUES (%s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['MId'], "text"),
GetSQLValueString($_POST['MPass'], "text"),
GetSQLValueString($_POST['MName'], "text"),
GetSQLValueString($_POST['MLastname'], "text"),
GetSQLValueString(isset($_POST['MSex']) ? "true" : "", "defined","'Y'","'N'"),
GetSQLValueString($_POST['MAddress'], "text"),
GetSQLValueString($_POST['MEmail'], "text"));
|
|
|
|
|
Date :
2013-03-07 15:21:28 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|