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 Link to comment https://forums.phpfreaks.com/topic/161757-solved-can-anyone-deduct-a-reason-for-this-not-playing-ball/ Share on other sites More sharing options...
mike12255 Posted June 11, 2009 Share Posted June 11, 2009 were do you declare $page? Link to comment https://forums.phpfreaks.com/topic/161757-solved-can-anyone-deduct-a-reason-for-this-not-playing-ball/#findComment-853451 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 Link to comment https://forums.phpfreaks.com/topic/161757-solved-can-anyone-deduct-a-reason-for-this-not-playing-ball/#findComment-853453 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. Link to comment https://forums.phpfreaks.com/topic/161757-solved-can-anyone-deduct-a-reason-for-this-not-playing-ball/#findComment-853457 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 Link to comment https://forums.phpfreaks.com/topic/161757-solved-can-anyone-deduct-a-reason-for-this-not-playing-ball/#findComment-853461 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. Link to comment https://forums.phpfreaks.com/topic/161757-solved-can-anyone-deduct-a-reason-for-this-not-playing-ball/#findComment-853472 Share on other sites More sharing options...
mike12255 Posted June 11, 2009 Share Posted June 11, 2009 "$date.txt"; - suposed to be a variable? Link to comment https://forums.phpfreaks.com/topic/161757-solved-can-anyone-deduct-a-reason-for-this-not-playing-ball/#findComment-853474 Share on other sites More sharing options...
haku Posted June 11, 2009 Share Posted June 11, 2009 Heh, how did I miss that?! Link to comment https://forums.phpfreaks.com/topic/161757-solved-can-anyone-deduct-a-reason-for-this-not-playing-ball/#findComment-853478 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 Link to comment https://forums.phpfreaks.com/topic/161757-solved-can-anyone-deduct-a-reason-for-this-not-playing-ball/#findComment-853479 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 Link to comment https://forums.phpfreaks.com/topic/161757-solved-can-anyone-deduct-a-reason-for-this-not-playing-ball/#findComment-853489 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.