chaiwei Posted November 19, 2008 Share Posted November 19, 2008 Hi all, If I have an (index.php) <form action="haha.php" action="post"> <input type="submit" name="xx"> </form> then in (haha.php) i can use the if($xx){ } right? But i thought it must be use $_POST['xx']; Or it is because of the <form action="haha.php"> So can't use the $_POST['xx'] because in haha.php it still got another form? Another situation is if in index.php i got another input type with same name? <form action="haha.php" action="post"> <input type="text" name="xx"> <input type="submit" name="xx"> </form> So the $xx will refer to which one? EDIT: please use the code tags Quote Link to comment https://forums.phpfreaks.com/topic/133306-solved-and-xx/ Share on other sites More sharing options...
Zane Posted November 19, 2008 Share Posted November 19, 2008 But i thought it must be use $_POST['xx']; Or it is because of the If you are able to use $xx in haha.php then it means you have register_globals turned on. Which is a "bad" thing to have on..security wise. And yes $_POST['xx'] is the proper way to call it. There is also $_REQUEST['xx'] but I don't recommend ever using that. Another situation is if in index.php i got another input type with same name? So the $xx will refer to which one? it would take the value of the submit button. Quote Link to comment https://forums.phpfreaks.com/topic/133306-solved-and-xx/#findComment-693285 Share on other sites More sharing options...
chaiwei Posted November 19, 2008 Author Share Posted November 19, 2008 If you are able to use $xx in haha.php then it means you have register_globals turned on. Which is a "bad" thing to have on..security wise. And yes $_POST['xx'] is the proper way to call it. There is also $_REQUEST['xx'] but I don't recommend ever using that. Hi, Thanks a lot. But I don't understand what means by register_globals? Is it inside the phpinfo()? Quote Link to comment https://forums.phpfreaks.com/topic/133306-solved-and-xx/#findComment-693287 Share on other sites More sharing options...
Zane Posted November 19, 2008 Share Posted November 19, 2008 Well, you can look at phpinfo and see whether or not they're on or not but to really do anything you have to open up your php.ini file and find the line register_globals = On and change it accordingly...you know register_globals = Off Quote Link to comment https://forums.phpfreaks.com/topic/133306-solved-and-xx/#findComment-693291 Share on other sites More sharing options...
chaiwei Posted November 19, 2008 Author Share Posted November 19, 2008 Hi, Thanks. It helps me a lot. Quote Link to comment https://forums.phpfreaks.com/topic/133306-solved-and-xx/#findComment-693293 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.
× Pasted as rich text. Restore formatting
Only 75 emoji are allowed.
× Your link has been automatically embedded. Display as a link instead
× Your previous content has been restored. Clear editor
× You cannot paste images directly. Upload or insert images from URL.