Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- form.php
- <?php
- if (isset($_GET["msg"])){
- if ($_GET["msg"]=="true"){
- echo "Data Tersimpan nomor: ". $_GET["nomor"];
- }else{
- echo "GAGAL";
- }
- }
- ?>
- <form action="save.php" method="post">
- <input type="text" name="nomor" value="001"/>
- <input type="submit" name="simpan" value="Simpan"/>
- </form>
- save.php
- <?php
- $sql = mysql_query("INSERT INTO...");
- if($sql){
- // jika tersimpan
- header("location:form.php?msg=true&nomor=".$_POST["nomor"]);
- }else{
- header("location:form.php?msg=false);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement