illegaljose Posted July 11, 2009 Share Posted July 11, 2009 <form name="form1" method="post" <? if(isset($_POST['Submit'])){ $variable1 = $_POST['variable1']; $variable2 = $_POST['variable2']; $err = ''; if(trim($variable1)==''){ $err .= '<br>'; } if(empty($variable2)){ $err .= ''; } else{ $filename = 'data.txt'; $somecontent = $variable1 . ' ' . $variable2 . "\r\n"; if (is_writable($filename)) { if (!$handle = fopen($filename, 'a')) { echo "Cannot open file ($filename)"; exit; } // Write $somecontent to our opened file. if (fwrite($handle, $somecontent) === FALSE) { echo "Cannot write to file ($filename)"; exit; } echo "THANKS!"; fclose($handle); } else { echo "The file $filename is not writable"; } } } ?> <input type=hidden name="variable1" type="text" id="variable1" value="variable1"> <input type=hidden name="variable2" type="text" id="variable2" value="variable2"> <input type="image" src="submit.png" name="Submit" value="Submit" width="74" height="19"> </form> Link to comment https://forums.phpfreaks.com/topic/165584-solved-form-wont-post-in-ie/ Share on other sites More sharing options...
BillyBoB Posted July 11, 2009 Share Posted July 11, 2009 I'm not sure if this is how your coding is or not... but you have an error in the first line "<form name="form1" method="post"" should have a closing tag on it. So try "<form name="form1" method="post">" hopefully that helps. Link to comment https://forums.phpfreaks.com/topic/165584-solved-form-wont-post-in-ie/#findComment-873420 Share on other sites More sharing options...
haku Posted July 11, 2009 Share Posted July 11, 2009 That's one thing that is wrong with the code, and should be fixed. But the reason the form won't submit is because you need to change this: if(isset($_POST['Submit'])){ to this: if(isset($_POST['Submit_x'])){ Link to comment https://forums.phpfreaks.com/topic/165584-solved-form-wont-post-in-ie/#findComment-873438 Share on other sites More sharing options...
illegaljose Posted July 11, 2009 Author Share Posted July 11, 2009 ya that fixed it! Link to comment https://forums.phpfreaks.com/topic/165584-solved-form-wont-post-in-ie/#findComment-873770 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.