Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>GutMood - created to make you happy</title>
- <link href="styles.css" rel="stylesheet" type="text/css">
- <link href="css/post.css" rel="stylesheet" type="text/css">
- </head>
- <body>
- <div id="postdiv">
- <a href="index.php" ><img id="backbut" src="img/backbut.svg" /></a>
- <h1>Submit a quote yourself</h1>
- <form name="skip" action="?" method="post">
- <input id="quotetext" name="thequote" type="text" value="The quote" onclick="javascript: this.value = ''"><br />
- <input id="subquote" name="submit" type="submit" value="Submit your quote">
- </form>
- <h3>Sorry, this feature doesn't work yet</h3>
- <a href="bug-report.php" title="Report a (lady)bug"><img id="bugreport" src="img/bug.svg" /></a>
- </div>
- <?php
- if($_POST){
- try {
- $pdo = new PDO('mysql:host=localhost;dbname=database;charset=utf8', 'brugernavn', 'kodeord',
- array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
- $stmt = $pdo->prepare("INSERT INTO temp(quote) VALUES (:quote)");
- $stmt->execute(array(':quote' => $_POST['thequote']));
- echo "Weee quote inserted!";
- } catch (Exception $e) {
- echo "Something went wrong: ".$e->getMessage();
- }
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement