You are here: Creating files using fopen that are unlocked! « PHP Programming Language « IT news, forums, messages
Creating files using fopen that are unlocked!

Posted by monomaniac21 on 10/12/95 11:26

Hi everyone

i'm trying to setup my website to create new webpages dynamically using
php but I am have a major problem in that whenever i create a file it
is always created locked so that it can only be read even when i
specify read and write access.

Here is a basic example of the code I am using (I am using a Mac OSX
10.3.9):

<?php

$filename = '/Users/myusername/sites/mysitefolder/newfile.php';
$mytext = 'my text';

fopen($filename, 'w+');
fwrite($filename, $mytext);
fclose($filename);

?>

When i run this program all it does is create a blank file with
read-only access. My question is what settings do I need to change that
will enable me to create writable files using PHP?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация