php-beginner Posted February 9, 2011 Share Posted February 9, 2011 Hello everyone, Can someone show me a way how to pass $_post variable from a form to a function? So, input username and input password to a function login($username, $password). Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted February 9, 2011 Share Posted February 9, 2011 something like... <?php if ($_SERVER['REQUEST_METHOD'] == "POST") { $username = isset($_POST['username'])?$_POST['username']:''; $password = isset($_POST['password'])?$_POST['password']:''; $return_val = login($username,$password); } ?> Quote Link to comment Share on other sites More sharing options...
php-beginner Posted February 9, 2011 Author Share Posted February 9, 2011 That is exactly what i need. Thankyou very much! 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.