Current location: Hot Scripts Forums » Programming Languages » PHP » create files in php


create files in php

Reply
  #1 (permalink)  
Old 04-27-04, 06:26 PM
banli banli is offline
Newbie Coder
 
Join Date: Feb 2004
Location: on a chair
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
create files in php

how do i create files in php?

im trying to create an auto-forum-installer. I got it to where it creates the dir for the user, as well as mysql stuff.

How do i get it to create a file (like make index.php in /home/suseless/public_html/s1/$username/)?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 04-28-04, 02:20 AM
blaw's Avatar
blaw blaw is offline
Junior Code Guru
 
Join Date: Dec 2003
Location: Vancouver, BC, Canada
Posts: 550
Thanks: 0
Thanked 0 Times in 0 Posts
Hi there,

If you use fopen() to open a file that doesn't exist, PHP will attempt to create that file. You have to have the right permissions, etc. Details can be found here: http://ca3.php.net/function.fopen

HTH.
__________________
Blavv =|
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 04-28-04, 09:19 AM
banli banli is offline
Newbie Coder
 
Join Date: Feb 2004
Location: on a chair
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
ok, thank you
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 10-31-08, 10:49 PM
mityelir88 mityelir88 is offline
Newbie Coder
 
Join Date: Oct 2008
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
you could also use the standard touch function.

as in:
touch( "file.txt" );
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Error when trying to create MySQL table via PHP HasansWeb PHP 5 05-19-11 07:59 AM
need to how can we create a tree structure in php rani PHP 2 08-29-06 07:12 AM
php files in a cgi-bin directory epic1231 PHP 7 12-31-03 04:42 PM
Declared Functions skipper23 PHP 4 12-17-03 11:06 AM
index page not showing up skipper23 PHP 3 12-15-03 02:10 PM


All times are GMT -5. The time now is 12:07 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.