FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


PHP fopen





mrcode
Hello everybody !
I'd like to know whether FriHost allows fopen statements and file writing or not ?

Also, how can i use fopen... for example if i would write "HELLO WORLD" into a file called text.txt ?


Thank you
kv
I guess file writing and reading is allowed as long as it is within your home directory. (You will not have permissions to write anywhere else anyway).
hexkid
mrcode wrote:
[...] how can i use fopen... for example if i would write "HELLO WORLD" into a file called text.txt ?


Check the very fine PHP Manual, specifically its entries on fopen() and fwrite().

The code to write "HELLO WORLD" in a file called text.txt could be
Code:
<?php
$f = fopen('text.txt', 'wb');
if ($f) {
  fwrite($f, "HELLO WORLD\n");
  fclose($f);
} else {
  exit('Unable to open "text.txt" for writing.');
}
?>
Related topics
PHP Write to line
users online, using php and text file
site colse/open with php
error in my PHP script
help with php
Some php probs..need some help plzz!
php include
PHP: Writing to txt file
MySQL and PHP problem in the future
How do i execute an sql file in a php script?
PHP Member System (using FOPEN)..
PHP File Read, and File Check?
PHP: fopen('./directory/$variable'); Problem
Php Warning: fopen
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.