Mick7676 Posted February 5, 2009 Share Posted February 5, 2009 Sorry firt time here dont know where to post this.. I was wondering if anyone could tell me why this code would not work in FF <?php $email = $_POST['email'] ; $name = $_POST['name'] ; $surname = $_POST['surname'] ; $city = $_POST['city'] ; $File = "names.txt"; $Handle = fopen($File, 'a'); fwrite($Handle, $email); fwrite($Handle, " "); fwrite($Handle, $name); fwrite($Handle, " "); fwrite($Handle, $surname); fwrite($Handle, " "); fwrite($Handle, $city); print "Data Added"; fclose($Handle); ?> Thanks Mick Link to comment https://forums.phpfreaks.com/topic/143899-php-script-not-working-in-ff-fine-in-ie-apache/ Share on other sites More sharing options...
killah Posted February 5, 2009 Share Posted February 5, 2009 <?php $name = $_POST['name']; $email = $_POST['email']; $surn = $_POST['surname']; $city = $_POST['city']; $file = 'names.txt'; $handle = fopen($file, 'a'); $write_to_file = $email.' '.$name.' '.$surname.' '.$city.'<br>'; if( !fwrite($handle, $write_to_file) ) { echo 'Error occured while writing to file.'; } else if( fwrite($handle, $write_to_file) ) { echo 'Data Added'; } fclose($handle); ?> Try that and if not try this: <?php $name = $_POST['name']; $email = $_POST['email']; $surn = $_POST['surname']; $city = $_POST['city']; $file = 'names.txt'; $handle = fopen($file, 'a'); $write_to_file = $email.' '.$name.' '.$surname.' '.$city.'<br>'; fwrite($handle, $write_to_file) echo 'Data Added'; fclose($handle); ?> Link to comment https://forums.phpfreaks.com/topic/143899-php-script-not-working-in-ff-fine-in-ie-apache/#findComment-755088 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.