私は、がデータベースに挿入されるsettings.phpとsaveSettings.phpページのウェブサイトを作っています。ここでページに改訂された後にブートストラップモーダルを表示する
これは私が試したものであるのsettings.php
echo '
<form action="saveSettings.php" method="POST">
<div class="form-group">
<textarea class="form-control no-resize" rows="4" id="profilecomment" name="profilecomment"></textarea>
</div>
<input type="submit" class="btn btn-success" name="submit" style="margin-top:10px" value="Submit" />
</form>
';
、ここsaveSettings.php
$userComment = $_POST["profilecomment"];
$updateComment = "UPDATE users SET comment = '$userComment' WHERE steamid = '$steamID' ";
header('Location: settings.php');
の一部の一部です:
を私はに私のモーダルロードスクリプトを追加しましたsettings.phpページ
<script>
$(window).load(function(){
$('#settingsSave').modal('show');
});
</script>
モーダルスクリプト:
<div class="modal fade" id="settingsSave" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<p>You have successfully saved your settings!</p>
</div>
</div>
</div>
</div>
私はそのためにはポップアップしない場合はわからない:
header('Location: settings.php');
私は、私はいくつかの助けを得ることができると思います。
あなたの新しい場所にパラメータを渡しますか?あなたは '$(window).load(function(){});'の中で 'console.log'を実行できますか、または一般的にJavascriptコンソールでエラーをチェックできますか? –
こんにちはまあ、それは@ジャワンRの答えが働いた。 –