Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- $con = mysqli_connect("localhost","root","","test");
- if(isset($_POST['save_checkbox']))
- {
- $name = $_POST['name'];
- $agree = $_POST['agree'];
- $liked = $_POST['liked'];
- $query = "INSERT INTO demo (name,agree,liked) VALUES ('$name','$agree', '$liked')";
- $query_run = mysqli_query($con, $query);
- if($query_run)
- {
- $_SESSION['status'] = "Inserted Successfully";
- header("Location: index.php");
- }
- else
- {
- $_SESSION['status'] = "Not Inserted";
- header("Location: index.php");
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement