ok,
i know i'm missing something VERY elementary, so maybe some pro out there can shed some light for me.. 🙂
i am trying to write a simple script that will write 5 variables to a file that will serve as a master list for me to view at times...
here is the script receiving the 5 variables from 'get.password.html':
<?php
function WriteToFile ($URL, $Description, $username, $password, $data)
{
$TheFile = "password.list.txt";
$Open = fopen ($TheFile, "a");
if ($Open) {
fwrite ($Open, "$URL\t$description\t$username\t$password\t$date\n");
fclose ($Open);
$Worked = TRUE;
} else {
$Worked = FALSE;
}
return $Worked;
}
// end of WriteToFile function.
?>
<HEAD>
<TITLE>password.list.txt</TITLE>
</HEAD>
<BODY>
<?php
/ this handles conditional data submitted by get.password.html /
$Pattern = "(http://)?([[:space:]]+)([[:alnum:].,-_?/&=])";
if (eregi($Pattern, $Array["URL"]))
{
$Replace = "<a href=\"http://\2\3\">\2\3</a>";
$Array["URL"] = eregi_replace($Pattern, $Replace, $Array["URL"]);
$CallFunction = WriteToFile ($Array["URL"], $Array["description"], $Array["username"], $Array["password"], $Array["date"]);
if ($CallFunction)
{
print ("Submission for -- \t$Array["URL"] - has been written to file.<BR>\n");
} else {
print ("Submission was not written to file. Review script for errors.\n");
}
}
?>
This script always yields the following error:
Parse error: parse error, expecting T_STRING' orT_VARIABLE' or `T_NUM_STRING'
I hope I was clear enough in this... Thanks for whatever help you can offer!
andrew