Hi, I wonder if anyone can help me: Basically I'm using the below script to add newly registered users to a file listing all the members.
But, I cannot get links to work inside the $message tag (in capitals). I want to convert the "id" field (the textfield named 'id' that gets sent to this script) into a link. So if someone submitted their user id as 'bob' it would actually write '<a href="profiles.php?id=bob">bob</a>'
Here's the script...
<?
/*
revannotate.php3
This is like annotate.php3, but works in reverse order ... in other words,
old messages are pushed down by new messages. The result is reversed time
flow.
Steve Yelvington <steve@yelvington.com>
*/
if ($message)
{
$name = strip_tags($name);
$message = strip_tags($message);
$message = ereg_replace("\r\n\r\n", "\n<P>", $message);
if (get_magic_quotes_gpc())
{
$message = stripslashes($message);
$name = stripslashes($name);
}
$MESSAGE= "$ID\r\n";
// first read the file into a buffer, if it exists
$textfile = basename(user) . "s.htm";
if ($fp = @fopen ($textfile, "r")) // open without complaining
{
$oldmessages = @fread($fp,filesize($textfile));
@fclose(fp);
}
// now reopen the file in write mode, with the
// pointer at the head of the file
$fp = fopen ($textfile, "w");
fwrite ($fp, $message);
fwrite ($fp, $oldmessages); // adding back the old messages
fclose ($fp);
}
@readfile(basename((homelink . ".htm")));
?>
Thanks in advance for any help.