Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $db = new mysqli('host', 'username', 'password', 'database');
- if($_SERVER['REQUEST_METHOD'] == "POST" && isset($_POST['title'], $_POST['details']))
- {
- $title = $db -> real_escape_string($_POST['title']);
- $details = $db -> real_escape_string($_POST['details']);
- $email = '';
- if(isset($_POST['email']))
- {
- $email = $db -> real_escape_string($_POST['email']);
- }
- $db -> query("INSERT INTO `submissions` (`submission_id`, `submission_title`, `submission_details`, `contact_email`, `time_submitted`, `status`) VALUES(0, '$title', '$details', '$email', UNIX_TIMESTAMP(), 0)") or die ('Failed to submit, please try again soon');
- echo "Successfully Submitted";
- }
- ?>
- <html>
- <head>
- </head>
- <body>
- <center>
- <form action="submit.php" method="POST">
- <span style="font-size: 13px; font-family: lucida sans unicode;">
- <span style="font-size: 18px;">
- <b>Bug/Idea Submission Form</b>
- </span>
- <p>Title:</p>
- <input type="text" name="title" /><br />
- <p>Details:</p>
- <textarea name="details" rows="25" cols="50"></textarea><br /><br />
- <p>Contact Email <i>(Optional)</i>:</p>
- <input type="text" name="email" /><br />
- <input type="submit" value="Submit!" />
- </span>
- </form>
- </center>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement