I've been trying to create a simple little blog for something I want to add in my school assignment. All I want it to do is to output my input in the order it is entered (like a wall on facebook).
My code is:
<?php
//other form that does the password
$pass = $_POST['pass'];
$blog =$_POST['blog'];
?>
<form method="post"
action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
<textarea placeholder="Write Something, Me."
autofocus
required
autocomplete="off"
name="blog"></textarea>
<br />
<input type="password"
placeholder="Password"
autocomplete="off"
name="pass"
method="post" />
<input type="submit"
name="submit"
value="Submit">
</form>
<?php
If ($pass=="pass") {
echo 'Access Confirmed<br>';
echo $blog;
echo '<br/><br/>';
echo $blog;
echo '<br/><br/>';
echo $blog;
} else {
echo 'Wrong password or invalid blog entry. Try again Noob.<br>';
}
?>
I need to be able to call $blog as an array and output multiples datas as they are being entered (like in facebook). But as you can tell it's just printing the same thing over and over again. Also I don't want it do delete all the inputs if the "Password" (can't really call it secure) is entered incorrectly. I still want to be able to see the previous inputs.
I've tried many things, but none seem to work for me.
If this is unclear and you still have questions, please ask. Thanks.