在一個用戶配置文件的工作,有一個評論框,使其他用戶張貼在他們的個人資料的意見。我現在的工作,有一個動態的評論區一個取決於如果A.你是在尋找自己的個人資料B.看着別人的個人資料C.在所有未簽署改變文本框。我怎樣才能插入查詢與兩個if(isset報表?
我想實現「更新」現在,當你是你自己頁面,在評論框中輸入,然後輸出到頁面上的指定區域(將其輸出到社區頁面上,但尚未輸出)
在此配置文件頁面上,我有插入查詢插入正常的評論就好(第一次插入查詢),現在我試圖添加第二個if(isset語句與第二個插入查詢,並且在執行此操作時遇到問題。
它沒有插入,頁面在提交按鈕被擊中後加載空白。我是一個php btw新手。謝謝:
/* code chunk for the regular comments that is working just fine */
if(isset($_POST['commentProfileSubmit']) && $auth) {
$query = "SELECT `Email` FROM `Users` WHERE `id` = '" . $prof->id . "'";
$request = mysql_query($query,$connection) or die(mysql_error());
$result = mysql_fetch_array($request);
$Email = $result['Email'];
$to = $Email;
$subject = "$auth->first_name $auth->last_name left you a comment";
$message = "$auth->first_name $auth->last_name left you a comment: <br /><br /> <a href='http://www.blah.org/Profile.php?id=" . $prof->id . "'>Click here to view</a><br /><br />";
$from = "blah <[email protected]>";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= "From: $from";
mail($to, $subject, $message, $headers);
$query = "INSERT INTO `ProfileComments`
(`FromUserID`,
`ToUserID`,
`commentProfileBody`,
`status`,
`date`,
`time`
) VALUES (
'" . $auth->id ."',
'" . $prof->id ."',
'" . mysql_real_escape_string($_POST['ProfileComment']) ."',
'active',
'" . date("Y-m-d") . "',
'" . date("G:i:s") . "')";
mysql_query($query,$connection);
/* code chunk that is not inserting the desired info into the db and loading the page blank when I hit submit */
}elseif(isset($_POST['airwaveSubmit']) && $auth) {
$query2 = "INSERT INTO `Airwaves`
(`id`,
`body`,
`status`,
`date`,
`time`
) VALUES (
'" . $auth->id ."',
'" . $mysql_real_escape_string($_POST['body']) . "',
'active',
'" . date("Y-m-d") . "',
'" . date("G:i:s") . "')";
mysql_query($query,$connection);
}
?>
/* dynamic text/areas with dynamic submit buttons which is working how it should but want to include in case there is something on here that is causing the previous troubles */
<div id="commentBoxBlog">
<form name="CommentBox" method="post" action="Profile2.php?id=<?php echo $prof->id; ?>">
<?php if($auth->id == $prof->id) {
echo "<div id='counter'>
<span id='counter_airway'>140 Character Limit</span>
</div>";
echo "<textarea name='airwaveBody' class='round_10px' onkeyup='limit_length(this,140,\"counter_airway\");'></textarea> <input type='submit' name='airwaveSubmit' value='Exhale' class='post'/>";} elseif(!$auth) {
echo "<textarea name='ProfileComment' class='round_10px' disabled>Please sign in to comment...</textarea>"; } elseif($auth->id != $prof->id)
echo "<textarea name='ProfileComment' class='round_10px'></textarea>
<input type='submit' name='commentProfileSubmit' value='Exhale' class='post' />";
?>
</form>
</div>
有什麼在PHP錯誤日誌? – 2010-02-24 17:45:48
錯誤日誌已關閉。作爲一個新手,我有沒有影響我的網站的功能,一些枝節問題,但有很多的用戶,它會顯示的東西,這將使該網站看起來破碎,錯誤顯示明智的。 – 2010-02-24 17:49:04