Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

90 users online



Creating a file

Creating a file

Currently viewing this thread: 1 (0 members and 1 guests)


Static_Shock

Static_Shock

Status: Offline!

Creating a file

Hey, I was wondering if anyone could help me out, I want to be able to put text in, and a file name in, and have a script create the file for me, I was wondering if anyone can help me out, thanks!

___________________

[b][Static Shock][/b]


[img]http://phplab.shockonline.com/ss/sssig.gif[/img]


Currently working on [b]PHP Lab[/b], Offering PHP and HTML tutorials as well as free PHP scripts.

CDude

CDude

nothing
Status: Offline!

for creating empty files, you can try

PHP:

<?php

touch 
'/path/to/file.txt' );

?>

if you want to create a new file then write to it after, use fopen

http://us2.php.net/manual/en/function.fopen.php

___________________

http://celerondude.com

Static_Shock

Static_Shock

Status: Offline!

Awesome man, thanks a bunch Smile

___________________

[b][Static Shock][/b]


[img]http://phplab.shockonline.com/ss/sssig.gif[/img]


Currently working on [b]PHP Lab[/b], Offering PHP and HTML tutorials as well as free PHP scripts.

Static_Shock

Static_Shock

Status: Offline!

Is there anyway I can set the properties for the file? Because after it gets created, I have to manually chmod it so that I can edit it.

___________________

[b][Static Shock][/b]


[img]http://phplab.shockonline.com/ss/sssig.gif[/img]


Currently working on [b]PHP Lab[/b], Offering PHP and HTML tutorials as well as free PHP scripts.

vEr5e

vEr5e

Neverside Newbie
Status: Offline!

i usually use fopen with "w" and fputs into the file and it is ok...
if u want to change the mode, i think u can use
chmod("/usr/fullpath", 0666)

Rad

Rad

thinking of something witty to put here
Status: Offline!

touch('Scott');

BigToach

BigToach

Neversidian
Status: Offline!

fopen('radley');

___________________

Neverside Development Director
PHP Snippets
BigToach.com - IT WORKS, TOACHY!

Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.0075 seconds.