attila2452 Posted September 28, 2010 Share Posted September 28, 2010 <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 More sharing options...
Synook Posted September 28, 2010 Share Posted September 28, 2010 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 More sharing options...
attila2452 Posted September 28, 2010 Author Share Posted September 28, 2010 What happens when you try? Have you tried putting a space between the echo and the first quotation mark?It comes to a blank page. and i have even tried that. no change. Link to comment Share on other sites More sharing options...
CNT Posted September 28, 2010 Share Posted September 28, 2010 You have a extra bracket { in there...Chuck Link to comment Share on other sites More sharing options...
attila2452 Posted September 28, 2010 Author Share Posted September 28, 2010 You have a extra bracket { in there...Chuckcould you re-post it with the fix please? Link to comment Share on other sites More sharing options...
attila2452 Posted September 28, 2010 Author Share Posted September 28, 2010 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 More sharing options...
Synook Posted September 28, 2010 Share Posted September 28, 2010 Try it! Link to comment Share on other sites More sharing options...
attila2452 Posted September 28, 2010 Author Share Posted September 28, 2010 Try it!okay tried it and didn't do anything Link to comment Share on other sites More sharing options...
thescientist Posted September 28, 2010 Share Posted September 28, 2010 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 More sharing options...
attila2452 Posted September 28, 2010 Author Share Posted September 28, 2010 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 More sharing options...
chokk Posted September 29, 2010 Share Posted September 29, 2010 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.Do you have an http server installed? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.