Results 1 to 2 of 2
hi,i am learning php with fedora core 4, i wrote the code
************************************************** *****
$ourFileName = "testFile.txt";
$ourFileHandle = fopen($ourFileName, 'w') or die("can't open file");
fclose($ourFileHandle);
************************************************** *****
in my ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 03-13-2006 #1Just Joined!
- Join Date
- Feb 2006
- Posts
- 18
creating file with php
hi,i am learning php with fedora core 4, i wrote the code
************************************************** *****
$ourFileName = "testFile.txt";
$ourFileHandle = fopen($ourFileName, 'w') or die("can't open file");
fclose($ourFileHandle);
************************************************** *****
in my /var/www/html/firstphp.php, and opened it with my browser http://localhost/firstphp.php
and it says "can't open file", however, if the file never existed, it would now be created, quoted by www.tizag.com
" The file "testFile.txt" should be created in the same directory where this PHP code resides. PHP will see that "testFile.txt" does not exist and will create it after running this code. "
there is nothing called testFile.txt in my /var/www/html
- 03-13-2006 #2
Did you put the open and close tags in,
Code:<?php ?>


Reply With Quote
