westman Posted August 2, 2012 Share Posted August 2, 2012 i have an example code... <?phpif (isset($_POST['username'])){$username = $_POST['username'];}?><form action="index.php" id="username_form" name="username_form" method="post"><input name="username" id="username" type="text"><input name="username_submit" id="username_submit" type="submit"></form> my question is...is $username the name or the id?andhow can i get the name and id sepretly? Link to comment Share on other sites More sharing options...
boen_robot Posted August 2, 2012 Share Posted August 2, 2012 $username is neither.The 'username' in $_POST['username'] is the "name" of the input.The value of $_POST['username'] is the "value" of the input (well, the one that is present upon submission to be exact).In PHP, you can only get values by the name of the input. You can't get values by IDs. Link to comment Share on other sites More sharing options...
westman Posted August 2, 2012 Author Share Posted August 2, 2012 thank you Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now