Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form name = "quoted" method="post" onsubmit="get_action(this);">
- <input id = "poster" type="text" name="poster" required="required" placeholder = "Credited Individual."> <br>
- <textarea class = "actual_quote" name = "actual_quote" required="required" placeholder = "Write the question here!"></textarea><br><br><br>
- <div class = "checkboxes" required="required">
- <h3 style = "margin-top:-20px;">Please select one catagory that the quote falls into.</h3>
- <label for="x"><input type="radio" name="x" value="Inspirational" id = "inspirational.php" checked="checked" /> <span>Inspirational</span></label><br>
- <label for="x"><input type="radio" name="x" value="Funny" id = "funny.php" /> <span>Funny</span> </label><br>
- <label for="x"><input type="radio" name="x" value="OutofContext" id = "outofcontext.php"/> <span>OutofContext</span></label>
- </div>
- <input id = "submit1" name="submit1"s type="submit"><br>
- </form>
- <?php
- $db_name = 'submissions';
- $db_user = 'root';
- $db_pass = '';
- $db_host = 'localhost';
- try {
- $db = new PDO('mysql:host = localhost;dbname=submissions', $db_user, $db_pass);
- $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- } catch (PDOException $e) {
- echo 'Connection failed: ' . $e->getMessage();
- }
- $actual_quote = (isset($_POST['actual_quote']) ? $_POST['actual_quote'] : null);
- $poster = (isset($_POST['poster']) ? $_POST['poster'] : null);
- $sql = "INSERT INTO data (actual_quote, poster) VALUES ( :actual_quote, :poster)";
- $query = $db->prepare($sql);
- $query->execute(array(':actual_quote'=>$actual_quote, ':poster'=>$poster));
- ?>
- $actual_quote = (isset($_POST['actual_quote']) ? $_POST['actual_quote'] : '');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement