User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 401,952 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 3,276 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: 1223 | Replies: 2
Reply
Join Date: Feb 2007
Posts: 2
Reputation: sarita.t is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
sarita.t sarita.t is offline Offline
Newbie Poster

create a php link by creating by making directory in unix

  #1  
Feb 8th, 2007
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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2006
Location: Sofia, Bulgaria
Posts: 135
Reputation: Rhyan is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 7
Rhyan's Avatar
Rhyan Rhyan is offline Offline
Junior Poster

Re: create a php link by creating by making directory in unix

  #2  
Feb 12th, 2007
Originally Posted by sarita.t View Post
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.
Reply With Quote  
Join Date: Feb 2007
Posts: 4
Reputation: hradek is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
hradek hradek is offline Offline
Newbie Poster

Solution Re: create a php link by creating by making directory in unix

  #3  
Feb 13th, 2007
Originally Posted by sarita.t View Post
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.

  1. $temp_path = "some_path/".$name_of_directory."/";
  2. if(!file_exists($temp_path))
  3. {
  4. mkdir($temp_path, 0777);
  5. echo "<a href=\"".$temp_path."\" target=\"_self\">Link Text</a>";
  6. }
Last edited by hradek : Feb 13th, 2007 at 7:32 pm. Reason: Typo
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 5:37 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC