wSub.php is supposed to take a form and, based on the forms contents, create a directory and record the forms contents in that directory.
I know from testing with echo commands that the directory name and file name are good, but when I "uncomment" the code below which is supposed to create the directory and write the file, I get the errors that follow the code.
Code:
// >>> to test without filewriting, COMMENT OUT SECTION >>>
// check and create directory
$Directory="/Iw".$DirHour;
if (!is_dir($Directory)) mkdir($Directory, 0755);
else
// create file
$wp = fopen($wFileName, "w+");
$tryRecord = fwrite($wp, $wFile);
if ($tryRecord > -1) {
echo "<h2>Iwitness report recorded. Your report can be viewed as<br>http://iwitness.urnbandead.info/",$wFileName,"</h2><hr>";}
elseif ($tryRecord ==-1){
echo ("<h2>Iwitness report entry failed to record.<br>Please try again.</h2></h2>");}
else {die("wSub error CA7: Iwitness does not yet support screenshots of that type.");
// I wanted else{mail("sebwiers@urbandead.info", "Iwitness wSub alert",
// "wSub tryRecord variable value criteria for crack attempt alert met by user at $REMOTE_ADDR")
// but this gives a "no from field" error.
};
// <<< to test without filewriting, COMMENT OUT SECTION<<<
Result:
Warning: mkdir() [function.mkdir]: open_basedir restriction in effect. File(/Iw06-21-2007 16:00+) is not within the allowed path(s): (/home/sebwiers:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/sebwiers/public_html/iwitness/wSub.php on line 120
Warning: fwrite(): supplied argument is not a valid stream resource in /home/sebwiers/public_html/iwitness/wSub.php on line 124
die message- wSub error CA7: Iwitness does not yet support screenshots of that type.