Have a nice day to everyone!

Pls help me on how am i going to configure my document root and drives for the fact that i encounter this errors: pls... pls... pls...

Warning: mkdir() failed (No such file or directory) in C:\websites\pjs3\BillingRegularDetailedSave.php on line 1928

Warning: fopen("/PJS/2007-06-29/000002.txt", "a") - No such file or directory in C:\websites\pjs3\BillingRegularDetailedSave.php on line 1935Cannot open file (/PJS/2007-06-29/000002.txt)

Here is my code in creating directory and file.txt in doc root:

$dir1 = $_SERVER;
$datetoday =date("Y-m-d");
if (!file_exists("$dir1/PJS/$datetoday"))
$dir = mkdir("$dir1/PJS/$datetoday", 0700);
$result1 = mysql_query ("select bs_number, date, transactionType, subject_id, matter_id, client_id, attorney_id, rate, time, currency_nick, legalFees, fax, misc, misc_1, misc_2, misc_3, misc_4, photocopying, postage, printing, processing, telephone, transportation, vat, particulars from billingstatement") or die (mysql_error());

$filename = $_SERVER.'/PJS/'.$datetoday.'/'.$bsnum.'.txt';

if (!$handle = fopen($filename, 'a')) {
print "Cannot open file ($filename)";

if (is_writable($filename)) {

while ($row = mysql_fetch_row($result1)) {
$row_content = implode (",",$row)."\r\n";
// Write $row_content to our opened file.
if (!fwrite($handle, $row_content)) {
print "Cannot write to file ($filename)";

print "Success, content wrote to file ($filename)";


} else {
print "The file $filename is not writable";

Warning: unlink() failed (No such file or directory) in C:\websites\pjs3\BillingStatementRecordPerBSNumberShow.php on line 508

Here is my code for deleting a file in doc root and database.

$filename1 = $_SERVER.'/PJS/'.$fldbsnumdate1.'/'.$fldbsnumdelete.'.txt';


$result2 = mysql_query("delete from billingstatementhistory where bs_number = $fldbsnumdelete");

Please help. Im fresh to Php and for sure the error is does not direct to the document root and drives for the fact that it does not trace the directory of the doc root. pls help me. im meeting my deadline. this system works before but i used xampp so they require me to use IIS so i have to configure it manually. pls help. thanks a lot...

Edited by happygeek: fixed formatting

9 Years
Discussion Span
Last Post by php_daemon
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.