I have a form on my site where users can enter links to articles
So far... when a link is submitted, I am able to get that link to post to a destination html page.
However... if another link is submitted, it deletes the first one.
I would like the links to 'stack' and make a list to the destination (directory) page (which is currently an html page).
I don't know how to achieve this. Any advice or examples would be greatly appreciated.
I have include a very stripped down version of all three pages....
1.) The Form
<!DOCTYPE html>
<html>
<head>
<title>FORM</title>
<style>
body{margin-top:20px; margin-left:20px;}
.fieldHeader{font-family:Arial, Helvetica, sans-serif; font-size:12pt;}
.articleURL{margin-top:10px; width:700px; height:25px;}
.btnWrap{margin-top:20px;}
.postButton{cursor:pointer;}
</style>
</head>
<body>
<form action="urlUpload.php" method="post" enctype="multipart/form-data">
<div class="fieldHeader">Enter Article Link:</div>
<input class="articleURL" id="articleURL" name="articleURL" autocomplete="off">
<div class="btnWrap"><input class="postButton" type="submit" name="submit" value="POST"></button></div>
</form>
</body>
</html>
-
The Upload PHP (buffer) Page
<?php ob_start(); ?> <!DOCTYPE html> <html> <head> <title>urlUpload</title> <style>body{margin-top:20px; margin-left:20px;}</style> </head> <body> <?php $articleURL = htmlspecialchars($_POST['articleURL']); echo $articleURL;?> </body> </html> <?php echo ''; file_put_contents("urlDirectory.html", ob_get_contents()); ?>
3.) The Destination HTML 'Directory List' page
<!DOCTYPE html>
<html>
<head>
<title>urlDirectory</title>
<style>body{margin-top:20px; margin-left:20px;}</style>
</head>
<body>
Sumbitted URL's should be listed here:
</body>
</html>
PS: I may not even need the middle php 'buffer' page. My knowledge of this sort of thing is limited thus far. If I don't need that, and can skip that page to accomplish my needs, please advise as well.