FRIHOSTFORUMSSEARCHFAQTOSBLOGSCOMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Create a txt file





dionet
I need some help... I want a script to make a txt file(for example test.txt) when you execute it (php script)
Because I am making a theme script but i can´t remember how to make a file with php
Grimboy
Code:
file_put_contents (myfile.txt, "hello" + $person);
mostarac
Code:
$filename = "test.txt";
if (!file_exists($filename)) {
  touch($filename);
}
dionet
thank you, i will test the scirpts
BlackSkad
Code:

$filename = "test.txt";
if (is_file ($filename))
{
   // open it or (if it doesn't exist) make the file
   $file = fopen ($filename, "w");
   //Write something
   fwrite ($file, "Hello Dionet");
   //close the file
   fclose ($file);
}


This might help you too.
dionet
Yes, it helps me. Thank you again!!! Very Happy I can now continue my big project, lol Smile
Related topics
Creating a .txt file
.txt file to .php Lined to tables
does someone have a simple "save to txt file" scri
Displaying .txt file on web page
I can't open directly .txt file on my desktop
Saving a .txt file to a ftp using vb6. i need help please
VB 6.0 need help loading a .txt file into a text box
Can´t create new file in CPanel
is it possible to get a html text box to load a .txt file?
Cannot create file
robots.txt
how to create your own XXX gig file compressed to NNN kbytes
PHP: Writing to txt file
get to top in SEO ranking
This topic is locked: you cannot edit posts or make replies.    Frihost Forum Index -> Scripting -> Php and MySQL

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