Also habe ich eine Website, wo settings.php und saveSettings.php Seite, wo es $_POST
Funktionen zur Datenbank einfügen.Zeigt bootstraps modal nach redicted auf Seite
Hier ist ein Teil 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>
';
und hier Teil saveSettings.php
$userComment = $_POST["profilecomment"];
$updateComment = "UPDATE users SET comment = '$userComment' WHERE steamid = '$steamID' ";
header('Location: settings.php');
Dies ist, was ich versucht habe:
ich meine modalen Ladeskript hinzugefügt settings.php Seite
<script>
$(window).load(function(){
$('#settingsSave').modal('show');
});
</script>
Und modal Skript:
<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>
Ich bin nicht sicher, ob es wegen dem nicht: Pop-up
header('Location: settings.php');
Ich hoffe, dass ich etwas Hilfe bekommen kann.
Die 'modal' HTML ist auch in' settings.php' richtig? Können Sie eine 'console.log' in' $ (window) .load (function() {}); 'oder generell Ihre Javascript-Konsole auf Fehler überprüfen? –
Hallo ja es ist, @Javan R Antwort funktioniert. –