Make a .php file using php
- Mister-Mind
-
Mister-Mind
- Member since: Jul. 1, 2006
- Offline.
-
- Forum Stats
- Member
- Level 07
- Blank Slate
Is it possible to make a .php file inside a directory using php?
all posts are appreciated. I cant reply til tommrow so sorry.
All helps appreciated.
- novalyfe
- DFox
-
DFox
- Member since: Aug. 9, 2003
- Offline.
-
- Forum Stats
- Member
- Level 30
- Blank Slate
Yeah, it's really simple.
See here: http://us3.php.net/fopen
Just use that, and make the directory writable.
- Storm
-
Storm
- Member since: May. 19, 2006
- Offline.
-
- Forum Stats
- Member
- Level 05
- Blank Slate
Ya, I think it would be something like this:
$faction = fopen('test.php', x);
$write = 'bleep blap';
fwrite($faction, $write);
fclose($faction);
Should work, unless I've messed up. =P
- NinoGrounds
-
NinoGrounds
- Member since: Nov. 28, 2005
- Offline.
-
- Forum Stats
- Member
- Level 19
- Programmer
At 11/5/06 01:08 PM, Storm wrote: Ya, I think it would be something like this:
$faction = fopen('test.php', x);
$write = 'bleep blap';
fwrite($faction, $write);
fclose($faction);
Should work, unless I've messed up. =P
You did, it will return a fatal error.
Replace:
$faction = fopen('test.php', x);
with:
$faction = fopen('test.php', 'x');
And I think it will still return a permission denied error. You need to CHMO first (the directory).
- henke37
-
henke37
- Member since: Sep. 10, 2004
- Offline.
-
- Forum Stats
- Member
- Level 30
- Blank Slate
I hope you are totaly sure you know what you are doing, making new php files is exactly like eval, but saved to a file.
Each time someone abuses hittest, God kills a kitten. Please, learn real collision testing.



