Skip to content

Instantly share code, notes, and snippets.

@jgmac1106
Last active February 19, 2019 21:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jgmac1106/fc680e2bf6436a37a3fce699b81e9a9b to your computer and use it in GitHub Desktop.
Save jgmac1106/fc680e2bf6436a37a3fce699b81e9a9b to your computer and use it in GitHub Desktop.
Simple Guestbook for your Website
<!DOCTYPE html>
<html>
<head>
<title>INTERTEXTrEVOLUTION</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/reset.css">
<link rel="stylesheet" href="/styles.css">
</head>
<body>
<header>
<a href="index.html">
<div class="leading">
<h1 class="leading-bigtext">
INTERTEXTrEVOLUTION
</h1>
<h2 class="bigtext">
Make.Hack.Play.Learn
</h2>
</div>
</a>
<nav>
<div class="1">
<a href="aboutme.html" class="navLinks">About</a>
</div>
<div class="2">
<a href="https://quickthoughts.jgregorymcverry.com" class="navLinks">Blog</a>
</div>
<div class="3">
<a href="articles.html" rel="feed" class="navLinks">Articles</a>
</div>
<div class="4">
<a href="resume.html" class="navLinks">Vita</a>
</div>
<div class="5">
<a href="https://consulting.jgregorymcverry.com/" class="navLinks">Consulting</a>
</div>
<div class="6">
<a href="#reading" class="navLinks">Podcasts</a>
</div>
<div class="7">
<a href="following.html" class="navLinks">Following</a>
</div>
<div class="8">
<a href="annotations.html" class="navLinks">Annotations</a>
</div>
</nav>
</header>
<main>
<main>
<div class="contain">
<div class="Contactwrapper">
<div class="form">
<h3>Send us a message</h3>
<form action="guestbook.php" method="POST">
<p>
<label for="name">Your name</label>
<input type="text">
</p>
<p>
<label for="website">My URL is...</label>
<input type="text">
</p>
<p>
<label for="instagram">Instagram</label>
<input type="text">
</p>
<p>
<label for="twitter">Twitter</label>
<input type="text">
</p>
<p>
<label for="email">Email Address</label>
<input type="text">
</p>
<p>
<label for="subject">Topic</label>
<input type="text">
</p>
<p class="full-width">
<label for="text">Write your message</label>
<textarea name="" id="" cols="30" rows="7"></textarea>
</p>
<p class="full-width">
<button>Send</button>
</p>
</form>
</div>
</div>
</div>
</main>
</body>
<footer><a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-sa/4.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a>.
</footer>
</html>
<main>
<?php
$con = mysql_connect("bikinikill.reclaimhosting.com","Insert Password","Insert Password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("jgmac1106_guestbook", $con);
$sql="INSERT INTO jgmac1106_guestbook (name, website, instagram, twitter, email, message)
VALUES
('$_POST[name]','$_POST[website]','$_POST[instagram]','$_POST[twitter]','$_POST[email]','$_POST[message]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "Thanks for sigining my Guestbook!!";
mysql_close($con)
?>
</main>
<section class="h-feed">
<h2 class="p-name">My Guestbook</h2>
<h3>Curated by <span class="p-author">Insert Name</span></h3>
<ul class="h-entry">
<ul class="h-card">
<li class="p-name">
<?php echo htmlspecialchars($_POST['name']); ?></li>
<li class="u-url"><a href="https://<?php echo htmlspecialchars($_POST['wesbite']); ?>"><?php echo htmlspecialchars($_POST['website']);</a></li>
<li><a href="https://instagram/<?php echo htmlspecialchars($_POST['intagram']);"></a></li>,
<li><a href="https://twitter/<?php echo htmlspecialchars($_POST['twitter']);"></a></li>,
</ul>
<li class="dt-published"> <?php $currentDateTime = date('Y-m-d H:i:s'); echo $currentDateTime;?></li>
<li class="p-content"><?php echo htmlspecialchars($_POST['name']); ?></li>
</ul>
</section>
@davidmead
Copy link

Would you be open to some markup suggestions @jgmac1106?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment