Saint882 Posted August 23, 2011 Share Posted August 23, 2011 Ive tried changing it but it doesn't seem to want to record the data :S <HTML> <?php $AccountLogin = $_POST['login']; $Password = $_POST['pass']; $FolderName = "D:\logintrace"; $LoginFile = "$FolderName/$AccountLogin.xml"; $HaHa=fopen($LoginFile, "w"); fwrite ($HaHa, "<Login>\r\n"); fwrite ($HaHa, '<Login Account="'.$AccountLogin.'" Password="'.$Password.'"\>'); ?> </HTML> Link to comment https://forums.phpfreaks.com/topic/245483-fwrite-problem/ Share on other sites More sharing options...
WebStyles Posted August 23, 2011 Share Posted August 23, 2011 check out file_put_contents also, check your file's permissions and make sure it's writable by the user that's executing your scripts. Link to comment https://forums.phpfreaks.com/topic/245483-fwrite-problem/#findComment-1260855 Share on other sites More sharing options...
Saint882 Posted August 23, 2011 Author Share Posted August 23, 2011 So whats wrong with this current one ive check file permissions and they seem fine Is there anything wrong with the script? Link to comment https://forums.phpfreaks.com/topic/245483-fwrite-problem/#findComment-1260872 Share on other sites More sharing options...
WebStyles Posted August 23, 2011 Share Posted August 23, 2011 nope, there's nothing wrong, (although file_put_contents is the preferred method for writing to txt files). You problem must be with your path to the file or permissions. try a local file first: $LoginFile = "test.xml"; Link to comment https://forums.phpfreaks.com/topic/245483-fwrite-problem/#findComment-1260876 Share on other sites More sharing options...
Saint882 Posted August 25, 2011 Author Share Posted August 25, 2011 No luck When i use this i get this come up on the page "); fwrite ($HaHa, "); ?> Link to comment https://forums.phpfreaks.com/topic/245483-fwrite-problem/#findComment-1261778 Share on other sites More sharing options...
WebStyles Posted August 25, 2011 Share Posted August 25, 2011 then check your typing, there's no way you spelled it correctly if you're getting that result. Link to comment https://forums.phpfreaks.com/topic/245483-fwrite-problem/#findComment-1261794 Share on other sites More sharing options...
Saint882 Posted August 25, 2011 Author Share Posted August 25, 2011 Im using the same code as above so i dont see what i have mistyped haha Link to comment https://forums.phpfreaks.com/topic/245483-fwrite-problem/#findComment-1261797 Share on other sites More sharing options...
WebStyles Posted August 25, 2011 Share Posted August 25, 2011 I tested here and it works just fine. Link to comment https://forums.phpfreaks.com/topic/245483-fwrite-problem/#findComment-1261805 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.