Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[PHP] Problem with files

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Elec0
Expert Cheater
Reputation: 0

Joined: 21 Nov 2007
Posts: 188
Location: Out of my mind, back in five minutes.

PostPosted: Sun Dec 30, 2007 6:18 pm    Post subject: [PHP] Problem with files Reply with quote

I am having a problem creating, reading to, and writing to files. Here is my code:
Code:

$fh=fopen("/test/test.txt", "r");
if($fh==false)

die("unable to create file");


And, yes there is a folder called /test/.

I was wondering if someone could help me with this, I can't seem to figure it out.

Thanks,
~Elec0

_________________
Back to top
View user's profile Send private message MSN Messenger
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sun Dec 30, 2007 6:49 pm    Post subject: Reply with quote

Embrace your error with brackets:

Code:
$fh=fopen("/test/test.txt", "r");
if($fh==false)
{
   die("unable to create file");
}


If the folder is named 'test' and the file is 'test.txt' you should probably just use:

Code:
$fh=fopen("test/test.txt", "r");
if($fh==false)
{
   die("unable to create file");
}


If that doesn't work, try using the full path.

For more info and such on fopen:
http://us.php.net/manual/en/function.fopen.php

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Elec0
Expert Cheater
Reputation: 0

Joined: 21 Nov 2007
Posts: 188
Location: Out of my mind, back in five minutes.

PostPosted: Sun Dec 30, 2007 7:16 pm    Post subject: Reply with quote

Okay, thanks. I'll try that and see if it works.



Edit: Okay, I tried that code and it didn't work. I also tried the full path, (/test/test.txt.) That didn't work either.

~Elec0

_________________
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites