slapme Posted March 2, 2008 Share Posted March 2, 2008 Below is a script that automatically adds a index.html file to a newly created folder. What I would like to do is also add an inde.php file and others. So what/where would I add to the script to have this happen? forgive the noob Thanks Slappy } } /** * Create default index.html file * * @param string path */ function putIndexHTML ($path) { if !is_file ($path . '/index.html')) { $handle=fopen ($path . '/index.html',"w+"); fwrite ($handle,"<html><body bgcolor='#FFFFFF'></body></html>"); fclose ($handle); } } Quote Link to comment Share on other sites More sharing options...
trq Posted March 2, 2008 Share Posted March 2, 2008 Kinda defeats the purpose of a dynamic website but hey..... <?php function putIndexHTML ($path) { if !is_file ($path . '/index.html')) { $handle=fopen ($path . '/index.html',"w+"); fwrite ($handle,"<html><body bgcolor='#FFFFFF'></body></html>"); fclose ($handle); $handle=fopen ($path . '/index.php',"w+"); fwrite ($handle,"<html><body bgcolor='#FFFFFF'></body></html>"); fclose ($handle); } } ?> Quote Link to comment Share on other sites More sharing options...
slapme Posted March 2, 2008 Author Share Posted March 2, 2008 Im sorry I did not make myself clear in my first post. I meant to say that I wanted to COPY some index.php and other files to the same place the index.html file is going. The the advice Thorpe gave did work, but all it created was a blank php file, sorry for the confusion Slappy Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.