HTML form variables don't get sent to PHP [closed]

hbingol

New Member
I have the HTML code:\[code\]<form id="loginForm" name="loginForm" method="post" action="register.php"> <input name="first_name" type="text" class="textfield" id="first_name" /> <input name="last_name" type="text" class="textfield" id="last_name" /> <input name="username" type="text" class="textfield" id="username" /> <input name="password" type="password" class="textfield" id="password" /> <input name="cpassword" type="password" class="textfield" id="cpassword" /> <input type="submit" name="Submit" value="http://stackoverflow.com/questions/13848579/Register" /></form>\[/code\]and in register.php I have a sql connect and query, but when I execute my query:\[code\]$query = "INSERT INTO members (firstname, lastname, login, passwd) VALUES ('".$fname."', '".$lname."', '".$username."', '".$pwd."')"\[/code\]I only get the correct value for my password, the others are empty, so I tried:\[code\]echo $_POST['username'];\[/code\]and that gave an empty string :(How is this possible? \[code\]$_POST['']\[/code\] is the correct syntax right? Because it works for the password...complete index.html:http://pastebin.com/Q6CWGWNgcomplete register.php:http://pastebin.com/krdeMh39
 
Back
Top