•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 426,141 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,688 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 2012 | Replies: 1
![]() |
•
•
Join Date: May 2007
Posts: 59
Reputation:
Rep Power: 2
Solved Threads: 0
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 1935
Cannot open file (/PJS/2007-06-29/000002.txt)
Here is my code in creating directory and file.txt in doc root:
$dir1 = $_SERVER['DOCUMENT_ROOT'];
$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['DOCUMENT_ROOT'].'/PJS/'.$datetoday.'/'.$bsnum.'.txt';
if (!$handle = fopen($filename, 'a')) {
print "Cannot open file ($filename)";
exit;
}
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)";
exit;
}
}
print "Success, content wrote to file ($filename)";
fclose($handle);
} 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['DOCUMENT_ROOT'].'/PJS/'.$fldbsnumdate1.'/'.$fldbsnumdelete.'.txt';
unlink($filename1);
$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...
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 1935
Cannot open file (/PJS/2007-06-29/000002.txt)
Here is my code in creating directory and file.txt in doc root:
$dir1 = $_SERVER['DOCUMENT_ROOT'];
$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['DOCUMENT_ROOT'].'/PJS/'.$datetoday.'/'.$bsnum.'.txt';
if (!$handle = fopen($filename, 'a')) {
print "Cannot open file ($filename)";
exit;
}
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)";
exit;
}
}
print "Success, content wrote to file ($filename)";
fclose($handle);
} 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['DOCUMENT_ROOT'].'/PJS/'.$fldbsnumdate1.'/'.$fldbsnumdelete.'.txt';
unlink($filename1);
$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...
•
•
Join Date: Aug 2006
Posts: 138
Reputation:
Rep Power: 3
Solved Threads: 2
$_SERVER['DOCUMENT_ROOT'] is not defined in IIS, check this user comment on PHP Manual: http://www.php.net/manual/en/reserve...bles.php#59409
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- Open In New Window Php (PHP)
- HELP! I get an erro when including PEAR.php file (PHP)
- uploaded file moving to new directory (PHP)
- I get the error no file or directory when i try to run a perl script (Perl)
- HTTP Error 404 - File or directory not found. (ASP.NET)
- No such file or directory (C)
Other Threads in the PHP Forum
- Previous Thread: novice needs help setting a membership up
- Next Thread: Software Developer Needed - Midi file converter to .lmz


Linear Mode