作者roger70349 (roger70349)
看板PHP
標題[請益] 無法update
時間Mon Oct 22 14:15:58 2007
是否能請大大幫我看一下這隻程式錯在那裡
scenery_detail.php
<?
include("sql_connect.php");
include("my_msg.php");
include("db_func.php");
?>
<?
$sqlstr="SELECT * FROM scenery WHERE s_id='$s_id'";
$res=mysql_query($sqlstr);
$row=mysql_fetch_array($res);
//取出單筆資料內容
?>
<body bgcolor="#CCFFFF">
<center>
<p><font size="+6" color="#CC0000">風景區修改介面</font></p>
<p> </p>
</center>
<center>
<form name="form1" method="post" action="scenery_update.php">
<table width="50%" border="0" bgcolor="#00FFFF">
<tr>
<td>主題:<td><input type="text" name="s_title" size="20"
value="<?=$row['s_title']?>" disabled></td></td>
<tr><td>內容:<td><textarea rows="10" cols="35"
name="s_cont"><?=$row['s_cont']?></textarea>
</td></td>
</tr>
<tr><td><td>
<input type="submit" name="submit" value="送出">
<input type="reset" name="result" value="取消"></td>
</tr>
</table>
</form>
</center>
scenery_update.php
<?
include("sql_connect.php");
include("my_msg.php");
include("db_func.php");
?>
<?
if($check==upd)
{
$sqlstr="UPDATE scenery SET
s_title='$s_title',s_cont='".Changword($s_cont)."',
s_time='$s_time' where s_id='$s_id'";
db_query($sqlstr);
}
echo "<script>";
echo "alert(\"資料已更新\");";
echo "location.href = \"scenery_manage.php\";";
echo "</script>";
echo "<body onload = \"window.close();\">";
?>
沒任何錯誤,但資料卻無法更新,請大大能否幫我看一下,謝謝。
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 163.21.84.177
推 JoeHorn:if($check==upd) 程式在這邊沒有進入 10/22 14:46
→ roger70349:那應該如何修改比較好,謝謝。 10/22 15:22
→ aqzb:就要看你$check給的是什麼了.. 10/22 15:51
推 buganini:upd是啥? 10/22 22:58
推 buganini:constant? string? 10/22 23:12