rubing Posted June 23, 2008 Share Posted June 23, 2008 I see the following commonly used for detecting whether a form was submited. if(isset($submit)) { ...} yet when i try to incorporate it into my scripts it doesn't work :-\ Quote Link to comment Share on other sites More sharing options...
btherl Posted June 23, 2008 Share Posted June 23, 2008 For that to work you will need to have register_globals on, and you will need to have your submit button named "submit", all lowercase. And the form must have been submitted by clicking that submit button, not via a javascript submit() call. Quote Link to comment Share on other sites More sharing options...
DarkWater Posted June 23, 2008 Share Posted June 23, 2008 btherl, you just made register_globals sounds like a beneficial thing. Let me clarify. You would need register_globals on for that to work as-is, but seeing as register_globals is an epic failure, don't use them and just do $_POST['submit']. Quote Link to comment Share on other sites More sharing options...
redarrow Posted June 23, 2008 Share Posted June 23, 2008 do it this way or the high way register_globals on is bad programming now and turned off on php6 <?php if(isset($_POST['submit'])){ what_ever } ?> Quote Link to comment Share on other sites More sharing options...
DarkWater Posted June 23, 2008 Share Posted June 23, 2008 @redarrow: They aren't turned in in PHP6, they're turned off in PHP since 4.2... They're COMPLETELY REMOVED in php6. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted June 23, 2008 Share Posted June 23, 2008 ...And php4.2 was in April 2002, a long time ago in programming years. Quote Link to comment Share on other sites More sharing options...
rubing Posted June 23, 2008 Author Share Posted June 23, 2008 that makes sense...i was reading this in an older php book. Quote Link to comment Share on other sites More sharing options...
redarrow Posted June 23, 2008 Share Posted June 23, 2008 sorry there removed so sorry ........ here a recent php6 update ok mate.... http://davidwalsh.name/upcoming-php6-additions-changes Quote Link to comment Share on other sites More sharing options...
btherl Posted June 23, 2008 Share Posted June 23, 2008 Given how long it's taken for web hosts to switch to php 5, I don't think there's any danger of register_globals going missing anytime soon And no I am not endorsing register_globals by that statement. $_POST['submit'] is better (or $_GET['submit'] if you're using a get form, but you should be using a post form if possible) 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.