My original problem; A php to send email works but I can't get attachments to work.
To test it I created script.inc and uploaded it to the server.
Running the script in addition to the expected form I get this line at the bottom;
"\n"); fclose($fp); include($path."script.inc"); exit(); } } } ?>"
Pressing the "Test Script" button results in a "Page Not Found" error.
Here is what I believe script.inc should look like. I'm just guessing as the instructions are a little vague to me.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 TRANSITIONAL//EN">
<html>
<head>
<title></title>
</head>
<body>
<form action=echo $_SERVER['PHP_SELF']; method="post">
<br />
<br />
<textarea name="test_script" rows="15" cols="75"></textarea>
<br />
<input type="submit" name="submit" value="Test Script" />
</form>
</body>
</html>
<?php
/
You will need to create a file called script.inc
Upload to your server. CHMOD to 0666 or 0777, whichever works
for you, so that this script can write to it. Change $path to
where you uploaded script.inc, for example:
Say you uploaded to http://www.yourdomain.com/somefolder/script.inc
The path would be: http://www.yourdomain.com/somefolder/
/
if(!empty($POST['test_script']))
{
$script_to_test = $POST['emailform.php'];
$path = "http://www.divsol.com/employee/";
if($script_to_test)
{
$file = "script.inc";
if(file_exists($file))
{
$fp = fopen("$file", "w");
fwrite($fp, "<?php\n");
fwrite($fp, $script_to_test);
fwrite($fp, "?>\n");
fclose($fp);
include($path."script.inc");
exit();
}
}
}
?>