Jump to content

info need on POST


westman
 Share

Recommended Posts

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

$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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...