Getting started with PHP File-Trying to Create a Guest Book for My #IndieWeb Blog
I have very limited experience with PHP. Basically I have copy and pasted contact forms for years and occasionally hack around in WordPress.
More recently I have started to dig into Known as I find stuff I would like to do on my site.
Right now I am trying to have a php form on a website and spit out the results on the same page. I don't want to save the data anywhere but the webpage.
Here is my attempt to write the form and the template. Would love feedback on the fundementals. Here is a link to a Gist as well.
If I can get this part proper I can then go and figure out what magic I need to do to make it happen.
<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>
<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>
</main>



