Jump to content

How come this doesn't work?!


attila2452

Recommended Posts

<html><head></head><body><form  action="login.php" method="POST"><label>Username: </label><input type="text" name="user" /><label>Password: </label><input type="password" name="password" /><input type="submit" value="Submit" /></form> </body></html>

<?phpif(!empty($_POST["user"])){	echo"Your Username Inputted Was: ".$_POST["user"];else{	echo"Your Username Was Left Blank.";}?>

Link to comment
Share on other sites

What happens when you try? Have you tried putting a space between the echo and the first quotation mark?

Link to comment
Share on other sites

could you re-post it with the fix please?
no wait. dont i need it like this :
<?phpif(!empty($_POST["user"])){	echo "Your Username Inputted Was: ".$_POST["user"];}else{	echo "Your Username Was Left Blank.";}?>

with the { before the else and } after? so really i was missing one?

Link to comment
Share on other sites

so what's the issue here? I tested it and got it to work. Are you running this in a PHP enabled environment? Why not try adding error messaging, or echoing/var_dumping the POST array to make sure the form was passed correctly?

Link to comment
Share on other sites

so what's the issue here? I tested it and got it to work. Are you running this in a PHP enabled environment? Why not try adding error messaging, or echoing/var_dumping the POST array to make sure the form was passed correctly?
so as i got home today i updated it to a server. and it works. for some reason it doesn't just work on my desktop. i have PHP Installed.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...