![]() |
|
PHP Login - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Coding (https://sinister.ly/Forum-Coding) +--- Forum: PHP (https://sinister.ly/Forum-PHP) +--- Thread: PHP Login (/Thread-PHP-Login) |
PHP Login - ImMe - 11-21-2013 Code: <?php
echo 'Account ID:';
echo '<input type="text" name="user">';
echo 'Password:';
echo '<input type="text" name="pass">';
if(user == 'username' && pass == "password") {
echo 'You have successfully logged in'
} else {
echo 'Incorrect sign in info'
}
?>I thought this was right but I keep getting an error (specifically on line 9). If anyone can help please do. Thanks! :epic: PHP Login - ImMe - 11-21-2013 Code: <?php
echo 'Account ID:';
echo '<input type="text" name="user">';
echo 'Password:';
echo '<input type="text" name="pass">';
if(user == 'username' && pass == "password") {
echo 'You have successfully logged in'
} else {
echo 'Incorrect sign in info'
}
?>I thought this was right but I keep getting an error (specifically on line 9). If anyone can help please do. Thanks! :epic: RE: PHP Login - The Real Slim Shady - 11-21-2013 Ill tell you the problem when you add code tags and proper formatting. RE: PHP Login - The Real Slim Shady - 11-21-2013 Ill tell you the problem when you add code tags and proper formatting. RE: PHP Login - Slarek - 11-21-2013 I think when creating a form, HTML is better choice. Also take a note that all your echo's don't have a semicolon. RE: PHP Login - Slarek - 11-21-2013 I think when creating a form, HTML is better choice. Also take a note that all your echo's don't have a semicolon. RE: PHP Login - ImMe - 11-21-2013 I'm new to coding, and I'd really appreciate it if you actually helped me instead of making fun of my errors. RE: PHP Login - ImMe - 11-21-2013 I'm new to coding, and I'd really appreciate it if you actually helped me instead of making fun of my errors. RE: PHP Login - Slarek - 11-21-2013 No one was making fun, but you forgot to use codetags. What I'd suggest is that you use PHP and HTML when creating a login. Also put those missing semicolons to their places. Edit: I can't think how this could work since you're not using any variables. RE: PHP Login - Slarek - 11-21-2013 No one was making fun, but you forgot to use codetags. What I'd suggest is that you use PHP and HTML when creating a login. Also put those missing semicolons to their places. Edit: I can't think how this could work since you're not using any variables. |