phppup Posted June 16, 2018 Share Posted June 16, 2018 I have a basic <form action=insert.php> I developed it and have it working well. It provides confirmation and error messages upon submission as designed. When I visited a friend to show him the form, we used his Internet Explorer (not sure of the version) browser rather than the FIrefox that I had been used to. Naturally, the look was slightly different, but upon submission, it went to the PHP page with a simple one word message of: undefined. We used his laptop which had Chrome and all was well. Is there a known issue or coding that I need to avoid such instances in real use situations? Quote Link to comment Share on other sites More sharing options...
NotionCommotion Posted June 16, 2018 Share Posted June 16, 2018 You need to change <form action=insert.php> to <form action="insert.php">. Evidently, FF automatically "fixes" your mistake, but you should always ensure your HTML is valid. Use https://validator.w3.org/ to show errors until you have none. Quote Link to comment Share on other sites More sharing options...
requinix Posted June 16, 2018 Share Posted June 16, 2018 "undefined" is a Javascript thing - it wouldn't have come from PHP... 1 Quote Link to comment Share on other sites More sharing options...
phppup Posted June 17, 2018 Author Share Posted June 17, 2018 (edited) I believe the quote marks are in the original scripting, just not included in the expedited question entry. Also, I will double check, but I do not recall placing any JavaScript in my coding (as PHP was giving me enough troubles on its own... LOL). Edited June 17, 2018 by phppup Quote Link to comment Share on other sites More sharing options...
NotionCommotion Posted June 17, 2018 Share Posted June 17, 2018 You will want to rule out potential issues. Use https://developer.mozilla.org/en-US/docs/Tools/Network_Monitor to see if the request is actually being made to your server. If not, use JavaScript's console.log() to investigate. If so, use PHP's syslog() to investigate. Quote Link to comment Share on other sites More sharing options...
maxxd Posted June 17, 2018 Share Posted June 17, 2018 (edited) This is too vague to answer, I think - is the 'undefined' something you wrote in your code? Are you using third party libraries? Post your form and processing code and we'll take a look. My initial thought is that you're doing something like if(isset($_POST['submit'])){ // process the form }else{ echo 'undefined'; } (assuming the submit button is named 'submit') which won't work with Internet Explorer. But that's only my initial thought because it's something that has bitten a lot of developers. Edited June 17, 2018 by maxxd Clarification Quote Link to comment Share on other sites More sharing options...
phppup Posted June 18, 2018 Author Share Posted June 18, 2018 Nope, I don't create messages that say things like "undefined." My messages are more specific and fun (like echo "Time for lunch" which is always easy to find in a script). Quote Link to comment Share on other sites More sharing options...
benanamen Posted June 18, 2018 Share Posted June 18, 2018 You will get much better help if you post your code. Quote Link to comment Share on other sites More sharing options...
phppup Posted June 21, 2018 Author Share Posted June 21, 2018 KUDOS to requinix. You were correct. After closer review I realized that I had used a JavaScripted datepicker in my form and it was causing the quirky error. After removing it, the error vanished. Replaced it with a simple HTML <input type='date'> and seems to be okay. GOOD CALL, 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.