wryd Posted August 17, 2006 Posted August 17, 2006 Hello. I am a new to this and I need help. I use a simple php file for test. Command to run: php /home/username/test.php test.php: <?php $starttime = time(); $fp = fopen('time.inc', 'w+'); if($fp) { fwrite($fp, $starttime); fclose($fp); } ?> why can't get any result? Quote
TCH-Bruce Posted August 17, 2006 Posted August 17, 2006 Welcome to the forums wryd In your fopen statement there is no path to the file you are trying to open. Quote
wryd Posted August 17, 2006 Author Posted August 17, 2006 Welcome to the forums wryd In your fopen statement there is no path to the file you are trying to open. Thanks. but how to write str to a file? Quote
TCH-Bruce Posted August 17, 2006 Posted August 17, 2006 You need to change your fopen to include the path to where you want to create the file. >$fp = fopen('/home/yourCpanelname/path-to/time.inc', 'w'); Quote
wryd Posted August 17, 2006 Author Posted August 17, 2006 You need to change your fopen to include the path to where you want to create the file. >$fp = fopen('/home/yourCpanelname/path-to/time.inc', 'w'); Thanks. It's OK. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.