Jump to content


Photo

fopen trouble!


  • Please log in to reply
6 replies to this topic

#1 haewk

haewk
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 28 February 2006 - 09:27 PM

I'm having trouble with fopen.

I'm using:

$post = "ok, so i want to write this to my textfile";
$fd = fopen("guestbook.txt","a") or die ("Cannot open guestbook.txt");
fwrite($fd, $post);
fclose($fd);

I says that i don't have the permission :-(

#2 Caesar

Caesar
  • Members
  • PipPipPip
  • Advanced Member
  • 1,025 posts

Posted 28 February 2006 - 09:30 PM

Did you CHMOD the permissions on that file you're trying to fopen() ? :-)
PHP Ninja

#3 haewk

haewk
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 28 February 2006 - 09:33 PM

[!--quoteo(post=350381:date=Feb 28 2006, 04:30 PM:name=Caesar)--][div class=\'quotetop\']QUOTE(Caesar @ Feb 28 2006, 04:30 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Did you CHMOD the permissions on that file you're trying to fopen() ? :-)
[/quote]

I cerntantly did not :-) How do I do that? I'm quite a newbie :-)


#4 Caesar

Caesar
  • Members
  • PipPipPip
  • Advanced Member
  • 1,025 posts

Posted 28 February 2006 - 09:50 PM

If you are on a Linux server, you can do it via your FTP client. Just right click on the file and select Properties/CHMOD & change the permissions accordingly. If it's a windows server, you will probably have to do it through your control panel.
PHP Ninja

#5 haewk

haewk
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 28 February 2006 - 09:54 PM

Right. Well, I don't own my own server, I'm using one of these net-servers you can sign up to and stuff. Is there no hope for me? Is there any other way?

#6 haewk

haewk
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 28 February 2006 - 10:51 PM

someone? Please?

#7 Caesar

Caesar
  • Members
  • PipPipPip
  • Advanced Member
  • 1,025 posts

Posted 28 February 2006 - 10:59 PM

Do you have FTP access to the site?

Try connecting using an FTP client, with your site's user/pass. And your FTP server name as "yourdomain.com". (Where "yourdomain.com", is your actual domain. :-P)

If you still have problems with it...PM me, and I will help.

Are you allowed to change permissions via the site's control panel? Probably not...but you may want to check this.
PHP Ninja




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users