Jump to content

[SOLVED] Write to Folder/File Doesn't Work, but Writing To File Works


cursed

Recommended Posts

<?php
include 'config.php';
$item = $_GET['web'];
$file = "/ips/$ip$magic.txt";
$Handle = fopen($file, 'a');
fwrite($Handle, "$item\n\r");
echo "Data Written, $ip";
fclose($Handle);
?>

 

So in this line:

file = "/ips/$ip$magic.txt";

If I take out /ips/ it works fine.

I have created the /ips/ folder and chmodded it to 777.

 

Any help would be greatly appreciated. Sorry for the newbie question.

 

Edit: Error info:

 

 

Warning: fopen(/ips/65.49.14.10158.txt) [function.fopen]: failed to open stream: No such file or directory in /home7/ahotbeve/public_html/ipodtouchmaster/testqq/lol/filewritetest.php on line 5

 

Warning: fwrite(): supplied argument is not a valid stream resource in /home7/public_html/filewritetest.php on line 6

Data Written, (my ip)

Warning: fclose(): supplied argument is not a valid stream resource in /home7/public_html//filewritetest.php on line 8

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.