Hi I have written a script where the user submits a website URL, website name and (optional) description, which is then added to a text file and displayed inline on the Links page of a website.
So basically this script is to add hyperlinks to a page...
Test the script out here (just add any link). Do you think this is a good system??
Here is my code:
[FONT=Courier New]<body>
<form method="POST" action="addlink.php">
<p>Website Address:<br>
<input type="text" name="hyperlink" value="http://"><br>
Website Name:<br>
<input type="text" name="sitename"><br>
Description (optional):<br>
<input type="text" name="description"></p>
<p><input type="submit" value="Add This Link!">
<input type="reset" value="Reset!"></p>
</form>
<?php
$file = fopen ( "links.txt" , "a" );
if ($POST[hyperlink] && $POST[sitename] > null)
{
fwrite ( $file , "<p><a href=\"$POST[hyperlink]\" target=\"_blank\">$POST[sitename]</a> - $POST[description]</p>\r\n" );
echo "You have added the following link: <a href=\"$POST[hyperlink]\" target=\"_blank\">$POST[sitename]</a> - $POST[description]<br>
Click <a href=\"links.php\">here</a> to visit the Links page";
}
?>
</body>[/COLOR][/FONT]
AND the follwing code is used to show links.txt on the Links page:
[FONT=Courier New]<?php
readfile ("links.txt")
?>[/FONT]