madspof Posted June 11, 2009 Share Posted June 11, 2009 I have this bit of code $myFile = "$date.txt"; echo $myFile; $fh = fopen($myFile, 'w') or die("can't open file"); fwrite($fh, $page); fclose($fh); and it will not write to the txt file and i cannot figure out why can anyone else see why ? thanks b4 hand madspof x Quote Link to comment Share on other sites More sharing options...
mike12255 Posted June 11, 2009 Share Posted June 11, 2009 were do you declare $page? Quote Link to comment Share on other sites More sharing options...
madspof Posted June 11, 2009 Author Share Posted June 11, 2009 oh year should of mentioned that been declared and i have put an echo before hand to make sure the variable are all set but the functions are just not writing to the txt file Quote Link to comment Share on other sites More sharing options...
haku Posted June 11, 2009 Share Posted June 11, 2009 Make sure the folder that the file is going into has write permissions. Quote Link to comment Share on other sites More sharing options...
madspof Posted June 11, 2009 Author Share Posted June 11, 2009 It does it is running on windows machine with abbyss server with php 5 still absolutly wammied with this one :s Quote Link to comment Share on other sites More sharing options...
haku Posted June 11, 2009 Share Posted June 11, 2009 You're going to have to show us where you have declared $page then. Quote Link to comment Share on other sites More sharing options...
mike12255 Posted June 11, 2009 Share Posted June 11, 2009 "$date.txt"; - suposed to be a variable? Quote Link to comment Share on other sites More sharing options...
haku Posted June 11, 2009 Share Posted June 11, 2009 Heh, how did I miss that?! Quote Link to comment Share on other sites More sharing options...
mike12255 Posted June 11, 2009 Share Posted June 11, 2009 i was sitting here eating a snack for bout 5 mins staring at it before i noticed xD Quote Link to comment Share on other sites More sharing options...
madspof Posted June 11, 2009 Author Share Posted June 11, 2009 lol the $date.txt works might not be effiecent but it works :s anyway i figured out what was wrong the file i was trying to edit was in a directory above that bloody file school boy error lol thanks Quote Link to comment Share on other sites More sharing options...
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.