Code: Select all
<?
function WriteToFile ($URL, $Description) {
//Function WriteToFile takes two arguments--URL and Description--which will be written to an external file
$TheFile = "data.txt";
$Open = fopen ($TheFile, "a");
if ($Open) {
fwrite ($Open,
"$URL\n $Description\n");
fclose ($Open);
$Worked = TRUE;
} else {
$Worked = FALSE;
}
}
//End of WriteToFile Function.
?>
<html>
<head>
<title>URL Submission</title>
<body>
<?php
/* this page receives and handles the data generated by "form.html" */
$Pattern = "http://)?(ї^ї:space:]]+)(її:alnum:]\.,-_?/&=])";
if (eregi($Pattern, $Arrayї"URL"])) {
$Replace = "<a href="http://\\2\\3" target="_new">\\2\3\</a>";
$Arrayї"URL"] = eregi_replace($Pattern, $Replace, $Arrayї"URL"]);
$CallFunction = WriteToFile ($Arrayї"URL"], $Arrayї"Description"]);
if ($CallFunction) {
print ("Your submission--$ArrayїURL]--has been received!<BR>\n");
} else {
print ("Your submission was not processed due to a system error!<br>\n");
}
} else {
print ("Print enter a valid Web address!\n");
}
?>
</body>
</html>NotePad wrote: <a href="http://m\3" target="_new">m\</a> MSN
It is supose to send the URL to the line with the discription on another..
I've tried everything and this still is not working correctly.