Posted on Sunday 20th May 2007 at 06:24 PM | |
Diablosblizz Senior Member |
Hey, I want Fopen to create a file using the type 'x'. Heres what I got so far: PHP Code
1 2
fopen('url' 'x');
How can I make the file name be random. I know that I should use a randomizer, but how do I set the name? Does anybody know, thanks! |
Posted on Sunday 20th May 2007 at 07:56 PM | |
DanielXP Senior Member |
PHP Code
1 2 3 4 5 6 7 8 9 10 11 12
<?
That makes a random name and saves it as a file |
Posted on Sunday 20th May 2007 at 08:46 PM | |
Diablosblizz Senior Member |
PHP Code
1 2 3 4 5 6 7 8 9 10
//Random number alpha (Letters + Numbers)
I added that. I want to create the file into here: Code http://24.36.122.119/forbidden/habbo/habs/habs/database/vouchers/ And I get this error with the code above: Code Warning: fopen(http://24.36.122.119/forbidden/habbo/habs/habs/database/vouchers/90fat) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections. in /home/diablosb/domains/hotelmario.info/public_html/members/shop.php on line 62 Warning: fputs(): supplied argument is not a valid stream resource in /home/diablosb/domains/hotelmario.info/public_html/members/shop.php on line 65 Warning: fclose(): supplied argument is not a valid stream resource in /home/diablosb/domains/hotelmario.info/public_html/members/shop.php on line 66 Help :(! |
Posted on Sunday 20th May 2007 at 09:10 PM | |
SkillMaster Senior Member |
CHMOD the file to 777 lol. it has no write permissions |
Posted on Sunday 20th May 2007 at 10:37 PM | |
Diablosblizz Senior Member |
I CHMODed the file to 777 (shop.php). Same error.. Note: Code Warning: fopen(http://24.36.122.119/forbidden/habbo/habs/habs/database/vouchers/MSF7Q) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections. in /home/diablosb/domains/hotelmario.info/public_html/members/shop.php on line 62 Its trying to open that file, when there is no file. I want it to create the file with a random name, and then put a variable called $gm. Any ideas? |
Posted on Sunday 20th May 2007 at 10:52 PM | |
DanielXP Senior Member |
Try getting rid of the full URL. PHP Code
1 2 3 4 5 6 7 8 9 10 11 12
<?
|
Posted on Sunday 20th May 2007 at 10:58 PM | |
Diablosblizz Senior Member |
I cannot remove the forum post because I am putting this code on frihost, but the server IP is on my computer. :S. |
Posted on Monday 21st May 2007 at 11:05 AM | |
DanielXP Senior Member |
Host the script on your xammp host then. |
Posted on Monday 21st May 2007 at 02:06 PM | |
Diablosblizz Senior Member |
Now thats an Idea !!! :P - Thanks! |