Jump to content

Combining directory name and string in file open


jr8rdt

Recommended Posts

I would like to get the file in d:\uploaded_logs\<directory_ based_on_chartID\filenames

 

how to do that?

 

 

$chart_id = $_REQUEST['id1'];

 

$fp_mr = file('d:\uploaded_logs\' . $chart_id . '\Average.txt');

$fp_realtime = file('d:\uploaded_logs\' .$chart_id . '\grand.txt');

 

it doesn't work

what is the correct way to do it ?

It doesnt matter where htdocs is, being it c:, d:, or c:\windows. U have to open/include files based on that directory. So if u have your files in c:\htdocs\logs\myfile.txt, u have to call it "logs/myfile.txt". Htdocs is your web server's root directory and u cant access others. About the logs in the d: drive, move them to htdocs, thats the only way.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.