954,591 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

create a php link by creating by making directory in unix

I want to know the solution for creating a link in php page by making a directory in unix.?if somebody knows the answer kindly reply.

Thank you

sarita.t
Newbie Poster
2 posts since Feb 2007
Reputation Points: 10
Solved Threads: 0
 
I want to know the solution for creating a link in php page by making a directory in unix.?if somebody knows the answer kindly reply. Thank you

I am not sure what precisely your question is - you want to use a php script to create a directory in a unix-like server, or, when you create a directory in the document tree, you need php to add a link to that directory?

Please advise and you'll get an answer.

Rhyan
Posting Whiz in Training
240 posts since Oct 2006
Reputation Points: 21
Solved Threads: 26
 
I want to know the solution for creating a link in php page by making a directory in unix.?if somebody knows the answer kindly reply. Thank you

Using PHP's mkdir function, also check if the directory exists. You can also use exec which can execute OS command line from within PHP. In either case, look at PHP's website for more info.

$temp_path = "some_path/".$name_of_directory."/";
if(!file_exists($temp_path))
{
     mkdir($temp_path, 0777);
     echo "<a href=\"".$temp_path."\" target=\"_self\">Link Text</a>";
}
hradek
Newbie Poster
4 posts since Feb 2007
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You