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

Member Avatar for Rhyan

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.

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>";
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.