大家..形式沒有提交PHP和HTML
試圖提交表單..和形式和PHP代碼是在同一個index.php文件
if(isset($_POST['post_form'])) {
echo "ISSET";
$post_sender=$id;
$post_reciever=$id2;
$post_cont=$_POST['news_text'];
$post_cont=htmlentities($post_cont);
$post_cont=mysql_real_escape_string($post_cont);
$post_sql=mysql_query("INSERT INTO wall_posts (from, to, content, date) VALUES ('$post_sender','$post_reciever','$post_cont',now())") or die(mysql_error());
}else{
echo "NOT SET";
}
HTML表單
<form method='POST' action='index.php' enctype='multipart/form-data' id='news_form' name='post_form' >
<textarea id='news_text' name='news_text' >type here..........</textarea>
<input type='submit' id='wall_post_btn' name='wall_post_btn' value='submit'>
</form>
哪裏是我的錯誤..?
沒有在code..the文件本身corrupted..just取得了一個新的PHP文件中的測試沒有錯......只是罰款...感謝傢伙..
有什麼問題,有什麼不行? –
我不認爲表單本身實際上會發送POST數據。如果您參考了其中一個文本元素,它會起作用嗎? 'if(isset($ _ POST ['news_text'])){' –