Jump to content

[SOLVED] Files & Folder Clarification needed...


Gnub

Recommended Posts

I've set up a small script, where depending on the results, set by the user, the script will put data in 1 file, and place it in 1 of 2 folders. 

 

I've searched here for any similar problems, but alas, none were found.  Googl'ing wasn't much help either. 

 

I can create the folders...and files, but how do i specify which folder to place the file?

Link to comment
https://forums.phpfreaks.com/topic/38887-solved-files-folder-clarification-needed/
Share on other sites

Try this "psuedo" coded function:

 

function StoreDataInFile($Type, $Descr)

{

$Folder = "";

switch($Type)

{

case 1 : $Folder = "/var/logs1/"; break;

case 2 : $Folder = "/var/logs2/"; break;

default : $Folder = "/var/logs3/"; break

}

//write $Descr to file or do whatever... in folder $Folder;

}

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.