我有一个 html 网站,我有这个 PHP 代码,可以将信息发送到我的数据库,然后将我重定向回 html 网站。
mysqli_query($con,"INSERT INTO games (Title, Developer, releaseYear)
VALUES ('$_POST[title]','$_POST[developer]','$_POST[releaseYear]')");
mysqli_close($con);
$url = 'http://localhost/mysite/index.html';
header( "Location: $url" );
现在我有了这个名为 searchResultBox 的 div。我想做的是在我被重定向后在该 div 中添加一个文本。
我尝试过使用在谷歌上找到的代码,但没有成功。这是我在stackoverflow上找到的。
$('#searchResultBox').append('<div>Added entry!</div>');
有任何想法吗?谢谢