I'm just delving into this stuff, and am not sure where to start in fixing the problem I'm about to lay out. If the information I provided isn't sufficient, then I apologize. Any help would be greatly appreciated.
First off, I'm getting these two error messages on a page:
1-Warning: fopen ("/usr/www/tipsfork/html/inc/admin/outgoing_email.txt", "r")- No such file or directory in /home/www/tipsforkids/modules/user/SendNewUserEmail.php3 on line 13 Error opening datafile
2-Warning: Supplied argument is not a valid File-Handle resource in /home/www/tipsforkids/modules/user/SendNewUserEmail.php3 on line 33
And...here's the php file they are referencing...the one with an error on lines 13 and 33:
<?
function SendNewUserEmail ($user_email, $user_fname, $user_mname, $user_lname, $user_login, $user_pwd) {
$subject = "Tips for Kids";
$user_name = $user_fname." ".$user_mname." ".$user_lname;
$user_email = "To: ".$user_name." <".$user_email.">";
$mail_header = "From: Tips for Kids <support@tipsforkids.com>\n";
// get mail content from text file now.
$mail_content = "";
$dataFile = "/usr/www/tipsfork/html/inc/admin/outgoing_email.txt";
$myFile = fopen ($dataFile, "r");
if (!$myFile) {
// error
?>
Error opening datafile.
<?
} else {
// loop through the data
$dataLine = "";
$lineCount = 0;
while (!feof($myFile)) {
$dataLine = fgets($myFile, 1000);
if (chop($dataLine) == "1234567890") {
$mail_content = $mail_content."Username: ".$user_login."\n";
$mail_content = $mail_content."Password: ".$user_pwd."\n";
} else {
$mail_content = $mail_content.$dataLine;
}
}
}
$closeReturn = fclose($myFile);
// send the email.
$send = mail($user_email, $subject, $mail_content, $mail_header);
}
?>
Obviously, I'm extremely new to this and am anxious to learn. Self-teaching myself this stuff and it's slow going. Thanks again for any help!