-4
我的MySQL數據庫有兩個表:‘Listing’
和‘country_id’
‘Country’
‘Country’
鏈接 '上市'
函數createrow()
在‘Listing’
中創建一個新行,這是通過使用下拉選擇框的'Submit'
按鈕完成的,然後將標題命令重定向到另一個頁面。
出於某種原因,我不知道,如果表‘Country’
包含超過35條記錄,我收到以下錯誤消息(35 ps的記錄頭命令重定向沒有錯誤):
警告:不能修改頭信息 - 已在第113行的C:\ xampp \ htdocs \ MySQLprtnr \ create.php中輸出的頭文件(輸出在C:\ xampp \ htdocs \ MySQLprtnr \ create.php:101開始)
代碼:
;
<input type="submit" name="Submit" value="Submit"></td>
</tr>
<?php
if (isset($_POST['Submit']))
{
$message = $_POST['message'];
$subject = $_POST['subject'];
$country_id = $_POST['country_id'];
createrow($message, $subject, $country_id);
header('Location: memberprofile.php');
}
?>
</form>
</table>
Line nu mbers:
線#101:<?php
線#113:'header('Location: memberprofile.php');'
我有以下兩個問題:
- 爲什麼我收到上述錯誤消息解釋呢?
- 因爲我沒有問題#1的解決方案,有沒有另一種方式來重定向,而不是'header'`(也許使用Javascript)?
感謝您的任何援助,