|
|
|
พอดีมีปัญหาครับ มือใหม่ ทำไมผมรันappserv แล้วมันขึ้น Internet Explorer cannot display the webpage |
|
|
|
|
|
|
|
ทำไมผมรันappserv แล้วมันขึ้น
Internet Explorer cannot display the webpage
ละครับ เป็นอยู่หน้าเดียวเลยCode (PHP)
<?php
require($_SERVER["DOCUMENT_ROOT"]."/class/Database.php");
$db = new Database();
?>
<?php
$g_id=$_REQUEST['g_id'];
$g_pic=$_REQUEST['g_pic'];
if(!empty($_POST["state"])) {
$ext = strtolower(end(explode('.', $_FILES["g_pic"]["name"])));
if($_FILES["g_pic"]["name"]!="")
{
$ints = date('YmdGis');$ext="";$ext1="";
$ext=substr($_FILES["g_pic"]["name"],strpos($_FILES["g_pic"]["name"],"."));
$img=$idalbum."gstu".$ints.$ext;
copy($_FILES["g_pic"]["tmp_name"],$_SERVER['DOCUMENT_ROOT']."/images/gstudent/$img") or die ("The file couldn't be copied to the server");
$up_img=",g_pic='$img'";
}
}
if($_POST["state"]=="add") {
$sql="INSERT INTO gstudent(g_name,g_detail,g_etc,g_pic,g_date) VALUES('".$_REQUEST["g_name"]."','".$_REQUEST["g_detail"]."','".$_REQUEST["g_etc"]."','$img',NOW())";
$db->execCommand($sql);
echo "<script type=\"text/javascript\">alert(\"กรอกข้อมูลเรียบร้อยแล้ว\");history.back();</script>";
} elseif($_POST["state"]=="edit") {
$sql="UPDATE gstudent SET g_name='".$_POST["g_name"]."' ,g_detail='".$_POST["g_detail"]."',g_etc='".$_POST["g_etc"]."'$up_img WHERE g_id='".$_POST["g_id"]."';";
$db->execCommand($sql);
}
header("location:add_gstu.php");
if($_GET["state"]=="del") {
$sql="DELETE FROM gstudent WHERE g_id='".$_GET["g_id"]."'";
$db->execCommand($sql);
header("location:add_gstu.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>
<script type="text/javascript" src="/scripts/fckeditor/fckeditor.js"></script>
<script type="text/javascript">
function setFCK(id, width, height) {
var oFCKeditor = new FCKeditor(id);
if(oFCKeditor) {
oFCKeditor.BasePath = "/scripts/fckeditor/" ;
oFCKeditor.Config["CustomConfigurationsPath"] = oFCKeditor.BasePath+"myconfig.js??"+(new Date()*1);
oFCKeditor.ToolbarSet = "MyToolBar";
oFCKeditor.Width = width;
oFCKeditor.Height = height;
oFCKeditor.ReplaceTextarea();
}
}
window.onload = function()
{
areas = document.getElementsByTagName("textarea");
for(var i = 0; i < areas.length; i++) {
setFCK(areas[i].id, 550, 200);
}
}
</script>
<style>
<!--
.style1 {color: #FF0000}
-->
</style>
</head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="200" valign="top" class="text1"></td>
<td valign="top">
<?php
if(!empty($_GET["g_id"])) {
$sql="SELECT * FROM gstudent WHERE g_id={$_GET["g_id"]}";
$rs=$db->getResultSet($sql);
$rows=$rs->getRow();
}
?><form id="form1" name="form1" method="post" action="" enctype="multipart/form-data" >
<table width="650" border="1" align="center" cellpadding="1" cellspacing="0">
<tr>
<td colspan="2" align="center" bgcolor="#3300FF">จัดการ G-Student</td>
</tr>
<tr>
<td valign="top"><p>ชื่อ </p>
<p>ข้อมูลใต้รูป</p></td>
<td><label for="textarea"></label>
<textarea name="g_name" id="g_name" cols="35" rows="5"></textarea></td>
</tr>
<tr>
<td valign="top">รายละเอียด</td>
<td><label for="textarea2"></label>
<textarea name="g_detail" id="g_detail" cols="35" rows="5"></textarea>
</td>
</tr>
<tr>
<td valign="top">รายละเอียดเพิ่มเติม</td>
<td><label for="textarea3"></label>
<textarea name="g_etc" id="detail2" cols="35" rows="5"></textarea></td>
</tr>
<tr>
<td>รูป</td>
<td><input type="file" id="g_pic" name="g_pic" /></td>
</tr>
<tr>
<td colspan="2" align="center" bgcolor="#3300FF"><input type="submit" name="button" id="button" value="บันทึก" />
<input name="g_id" type="hidden" id="g_id" value="<? echo $_REQUEST["g_id"]; ?>">
<input name="state" type="hidden" value="<? echo empty($_GET["state"])?"add":$_GET["state"]; ?>"></td>
</tr>
</table>
<div align="center"><br><br><br>
<input type="button" id="btnAdd2" name="btnAdd2" value="เพิ่มข้อมูล" onclick="document.location.href='<?php echo $_SERVER["PHP_SELF"]; ?>';" />
<br>
</div>
</form>
<!--show -->
<br>
<?
if($_REQUEST["stateeditpic"]=="editpic") {
?>
<table width="550" border="1" align="center" bordercolor="#666666" class="t_12_black">
<?php $sql = "SELECT g_pic FROM gstudent WHERE g_id='".$_REQUEST["g_ideditpic"]."'";
$rsZone = $db->getResultSet($sql);
$rowZone = $rsZone->getRow();?>
<tr>
<td valign="top" bordercolor="#E6E6E6" align="center"><? echo $rowZone["g_pic"];?></td>
</tr>
</table>
<?
}//end if state
?>
<br>
<table align="center" width="60%" border="1" cellpadding="1" cellspacing="0">
<tr>
<td width="9%" align="center" >ID</td>
<td width="9%" align="center" >ชื่อ</td>
<td width="44%" align="center" >หัวข้อ</td>
<td width="19%" align="center"> รูป</td>
<td width="12%" align="center" >แก้ไข</td>
<td width="7%" align="center" >ลบ</td>
</tr>
<?php $sql = "SELECT * FROM gstudent ORDER BY g_id DESC ";
$rsZone = $db->getResultSet($sql);
while($rowZone = $rsZone->getRow()){ ?>
<tr>
<td align="center"><? echo $rowZone["g_id"]; ?></td>
<td align="center"><? echo $rowZone["g_name"];?></td>
<td align="center"><? echo $rowZone["g_detail"];?></td>
<td align="center"><a href="?stateeditpic=editpic&g_ideditpic=<?php echo $rowZone["g_id"]; ?>"><img src='/rac.ac.th/images/gstudent/<? echo $rowZone["g_pic"];?>' width="50" /></a></td>
<td align="center" ><a href="?state=edit&g_id=<?php echo $rowZone["g_id"]; ?>">แก้ไข</a></td>
<td align="center" ><a href="?state=del&g_id=<?php echo $rowZone["g_id"]; ?>">ลบ</a></td>
</tr>
<?
}
?>
</table>
</table>
</body>
</html>
Tag : PHP
|
ประวัติการแก้ไข 2012-06-20 09:48:52
|
|
|
|
|
Date :
2012-06-20 09:46:52 |
By :
l3alLkisS |
View :
1125 |
Reply :
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ได้แล้วค้าบ ๆ
|
|
|
|
|
Date :
2012-06-20 10:01:10 |
By :
l3alLkisS |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
เป็นเพราะอะไรครับ
|
|
|
|
|
Date :
2012-06-20 10:15:58 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ดีใจด้วยะครับ ปัญญาเกิดจากอะไรเอ่ย
|
|
|
|
|
Date :
2012-06-20 10:16:23 |
By :
Joe_Dev |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ใส่ } ผิดที่ครับ
|
|
|
|
|
Date :
2012-06-20 11:19:39 |
By :
l3alLkisS |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
รบกวนอีกทีครับ แล้วผมต้องนำหน้านี้ไปใส่ตรงไหรเหรอครับ งงมาก
https://www.thaicreate.com/community/php-check-size-type-before-upload.html
|
|
|
|
|
Date :
2012-06-20 11:22:17 |
By :
l3alLkisS |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
แล้ว action="" เป็นไรเหรอครับ
|
|
|
|
|
Date :
2012-06-20 14:53:49 |
By :
l3alLkisS |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|