|
|
|
ผมใช้โค๊ดดึงหน้าเว็บ มาใช้ มันดึงได้หน้าแรก อะครับ พอหน้าที่ต้องกดตกลงมันเด้งออกอะครับ ทำไงดีครับช่วยแก้หน่อย |
|
|
|
|
|
|
|
ขอถามอะไรหน่อยครับผมใช้โค๊ดดึงหน้าเว็บ มาใช้ มันดึงได้หน้าแรก อะครับ พอหน้าที่ต้องกดตกลงมันเด้งออกอะครับ ทำไงดีครับช่วยแก้หน่อย
Code (PHP)
link rel="stylesheet" type="text/css" media="all" href="niceforms-default.css" />
<script language="JavaScript">
var HttPRequest = false;
function doCallAjax(url) {
HttPRequest = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
HttPRequest = new XMLHttpRequest();
if (HttPRequest.overrideMimeType) {
HttPRequest.overrideMimeType('text/html');
}
} else if (window.ActiveXObject) { // IE
try {
HttPRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
HttPRequest = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!HttPRequest) {
alert('Cannot create XMLHTTP instance');
return false;
}
var pmeters = "";
HttPRequest.open('POST',url,true);
HttPRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
HttPRequest.setRequestHeader("Content-length", pmeters.length);
HttPRequest.setRequestHeader("Connection", "close");
HttPRequest.send(pmeters);
HttPRequest.onreadystatechange = function()
{
if(HttPRequest.readyState == 3) // Loading Request
{
document.getElementById("mySpan").innerHTML = "Now is Loading...";
}
if(HttPRequest.readyState == 4) // Return Request
{
document.getElementById('mySpan').innerHTML = HttPRequest.responseText;
}
}
}
</script>
Code (PHP)
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
$File_tmpname = $_FILES["File"]["tmp_name"];
$File_name = $_FILES["File"]["name"];
$File_type = $_FILES["File"]["type"];
$File_size = $_FILES["File"]["size"];
$File_extension = substr($File_type,(strrpos($File_type,"/")+1));
if(empty($_FILES["File"]["name"])){
$File_name = $_POST['propic'];}
else if(($File_extension == "jpeg") || ($File_extension == "jpg")){
move_uploaded_file($File_tmpname, (".../".photos . "/" . AK . "/" . $File_name));
}
$updateSQL = sprintf("UPDATE akcom SET AK_Name=%s, AK_Initials=%s, AK_Address=%s, AK_Tel=%s, AK_Fax=%s, AK_mail=%s, AK_Web=%s, AK_Facebook=%s, AK_TaxId=%s, AK_RegId=%s,AK_MAP=%s, AK_UpdateDateTime=%s, AK_UpdateID=%s WHERE AK_id=%s",
GetSQLValueString($_POST['txtName'], "text"),
GetSQLValueString($_POST['txtlel'], "text"),
GetSQLValueString($_POST['txtAress'], "text"),
GetSQLValueString($_POST['txtlel'], "text"),
GetSQLValueString($_POST['txtFax'], "text"),
GetSQLValueString($_POST['txtmail'], "text"),
GetSQLValueString($_POST['txtweb'], "text"),
GetSQLValueString($_POST['txtfacebook'], "text"),
GetSQLValueString($_POST['txttaxid'], "text"),
GetSQLValueString($_POST['txtRegid'], "text"),
GetSQLValueString($File_name, "text"),
GetSQLValueString(date("Y-m-d H:i:s"),"text"),
GetSQLValueString($ids, "text"),
GetSQLValueString($_POST['hiddenFieldID'], "text"),
GetSQLValueString($_POST['hiddenFieldID'], "int"));
mysql_select_db($database_Conndb, $Conndb);
$Result1 = mysql_query($updateSQL, $Conndb) or die(mysql_error());
$com="true";
}
mysql_select_db($database_Conndb, $Conndb);
$query_Recordset1 = "SELECT * FROM akcom";
$Recordset1 = mysql_query($query_Recordset1, $Conndb) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<?php if ($com=="true")
doCallAjax(AKEditTrue.php);
?>
<script language="javascript" type="text/javascript" src="../adminak/niceforms.js"></script>
<link rel="stylesheet" type="text/css" media="all" href="../adminak/niceforms-default.css" />
</head>
<body>
<div class="form">
<form action="<?php echo $editFormAction; ?>" method="POST" enctype="multipart/form-data" name="form1" id="form1" class="niceform">
<table width="700" border="0" align="center" cellspacing="3" >
<tr>
<td width="195" rowspan="13" align="center" valign="top"><p> </p>
<p><img src="../photos/Untitled-4ak.png" width="217"></p>
<p> </p></td>
<td width="206">ชื่อกิจการ :</td>
<td width="273"><label>
<input name="txtName" type="text" id="txtName" value="<?php echo $row_Recordset1['AK_Name']; ?>">
</label></td>
</tr>
<tr>
<td>ชื่อย่อกิจการ :</td>
<td><label>
<input name="txtNit" type="text" id="txtNit" value="<?php echo $row_Recordset1['AK_Initials']; ?>">
</label></td>
</tr>
<tr>
<td colspan="2">ที่อยู่</td>
</tr>
<tr>
<td height="86" colspan="2" valign="top"><label>
<textarea name="txtAress" id="txtAress" cols="45" rows="5"><?php echo $row_Recordset1['AK_Address']; ?></textarea>
</label></td>
</tr>
<tr>
<td>เบอร์โทรศัพท์ :</td>
<td><label>
<input name="txtlel" type="text" id="txtlel" value="<?php echo $row_Recordset1['AK_Tel']; ?>">
</label></td>
</tr>
<tr>
<td>เบอร์โทรสาร :</td>
<td><label>
<input name="txtFax" type="text" id="txtFax" value="<?php echo $row_Recordset1['AK_Fax']; ?>">
</label></td>
</tr>
<tr>
<td>E-mail</td>
<td><label>
<input name="txtmail" type="email" id="txtmail" title="Ex. [email protected]" value="<?php echo $row_Recordset1['AK_mail']; ?>">
</label></td>
</tr>
<tr>
<td>Web</td>
<td><label>
<input name="txtweb" type="url" id="txtweb" title="" value="<?php echo $row_Recordset1['AK_Web']; ?>">
</label></td>
</tr>
<tr>
<td>Facebook</td>
<td><label>
<input name="txtfacebook" type="url" id="txtfacebook" value="<?php echo $row_Recordset1['AK_Facebook']; ?>">
</label></td>
</tr>
<tr>
<td>เลขประจำตัวผู้เสียภาษี</td>
<td><label>
<input name="txttaxid" type="text" id="txttaxid" value="<?php echo $row_Recordset1['AK_TaxId']; ?>">
</label></td>
</tr>
<tr>
<td>เลขทะเบียนนิติบุคคล</td>
<td><label>
<input name="txtRegid" type="text" id="txtRegid" value="<?php echo $row_Recordset1['AK_RegId']; ?>">
</label></td>
</tr>
<tr>
<td colspan="2">แผนที่
<label>
<input type="file" name="File" id="File">
</label></td>
</tr>
<tr>
<td colspan="2" align="center" valign="middle"><img src="../photos/AK/<?php echo $row_Recordset1['AK_MAP']; ?>" width="200"><input value="<?php echo $row_Recordset1['AK_MAP']; ?>" name="propic" type="hidden" id="propic" /></td>
</tr>
<tr>
<td colspan="3" align="center"><label>
<input type="submit" name="Update" id="Update" value="Update" OnClick="JavaScript:doCallAjax();">
</label></td>
</tr>
</table>
<input name="hiddenFieldID" type="hidden" id="hiddenFieldID" value="1">
<input type="hidden" name="MM_update" value="form1">
</form>
Tag : PHP, HTML/CSS, JavaScript, Action Script, Ajax, CakePHP
|
|
|
|
|
|
Date :
2012-01-16 15:58:00 |
By :
ืำีืneung |
View :
1140 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
อธิบายคำถามด้วยครับ ความต้องการคืออะไร อ่านแล้ว งง
|
|
|
|
|
Date :
2012-01-16 17:03:07 |
By :
boodemon |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
เอา code ยาว ๆ มาแปะ แล้วถาม บางครั้งมัน debug ด้วยสายตายากมากครับ
|
|
|
|
|
Date :
2012-01-16 17:08:56 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|