jlknauff Posted December 16, 2015 Share Posted December 16, 2015 (edited) OK, it's been a while since I've programmed anything in PHP...what am I missing here? If I print_r the post variable, I get the submit, but not the input field. I talked tech support at my hosting company and all they could tell me was that it was hitting a mod sec rule . <?php if (!$_POST) { ?> <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>jQuery UI Datepicker - Animations</title> <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script> <link rel="stylesheet" href="/resources/demos/style.css"> <script> $(function() { $( "#date1" ).datepicker({ minDate: 0, maxDate: "+36M" }); }); </script> </head> <body> <form method="post" action="#"> <input type="text" id="date1" size="8"> <br /> <input type="text" id="date2" size="8"> <br /> <input type="submit" name="submit"> </form> </body> </html> <?php } else { echo $_POST['post1']; echo $_POST['post2']; } ?> Edited December 16, 2015 by jlknauff Quote Link to comment https://forums.phpfreaks.com/topic/299773-what-is-wrong-with-this-form/ Share on other sites More sharing options...
Solution requinix Posted December 16, 2015 Solution Share Posted December 16, 2015 Ah, hosting support... Form inputs only work if you give them names. The IDs are just for the client side - mostly Javascript. <form method="post" action="#"> <input type="text" id="date1" name="post1" size="8"> <br /> <input type="text" id="date2" name="post2" size="8"> <br /> <input type="submit" name="submit"> </form> Quote Link to comment https://forums.phpfreaks.com/topic/299773-what-is-wrong-with-this-form/#findComment-1528031 Share on other sites More sharing options...
jlknauff Posted December 16, 2015 Author Share Posted December 16, 2015 Damn it...I knew I missed something stupid. Thank you! Quote Link to comment https://forums.phpfreaks.com/topic/299773-what-is-wrong-with-this-form/#findComment-1528032 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.