O.P. PHP - Gestbook.... help
Ok i'm trying to work on a script where my friends (who have photo's on there photobucket accounts etc....) can upload the img url to my form and it adds it to a flattext file, basicly its a modifyed guestbook, but i have little/no knowladge of PHP, i have got this to work in some shape or form, but whats making me struggle is i cant get the new entrys to go to the top of the page instead of being added to the bottom. i know its not possable to write to the top of a flat text, and the way to do this would be to get it to open the existing content from the file and then add that to the end of the new entry, and write it all in at once....? but i dont know how... any suggestions. heres my code:
<html>
<head>
<title>Upload</title>
</head>
<body>
<?php
include('config.php');
$user = $_GET["name"];
$message = $_GET["message"];
print("<b>Thank You!</b><br />Your information has been added! You can see it by <a href=savedinfo.php>Clicking Here</a>");
$out = fopen("savedinfo.php", "a");
if (!$out) {
print("Could not append to file");
exit;
}
fputs ($out,implode,("\n"));
fwrite($out,"<CENTER><font size='2' face='Verdana'><A href='$user' target='_blank'><img src='$user' width='300' height='200' style='border-color:#000000' border='1'></a><BR>$message<BR><BR></font></CENTER>");
fclose($out);
?>
</body>
</html>
user/name is the url of the image, message is simply a description. Thankyou in advance.
Kirk
|