Parse Error on isset? [PHP] -


i'm quite new http/php coding , i'm having little trouble isset in php. current code below, it's supposed check if username , password admin , password, if so, echo them info.

however, doesn't work. there no errors, accepts usernames , passwords.

$username = isset($_post['password']); $password = isset($_post['username']); $date = date('d-m-y'); $time = date('h:m:s'); $day = date('l');  if($username == 'admin' , $password == 'password') { //echo bla bla bla.. 

isset checks if variable set. usercase, on otherhand, needs check actual values:

if(isset($_post['username']) ,    $_post['username'] == 'admin' ,    isset($_post['password']) ,    $_post['password'] == 'password') {    // echo... 

in order use isset() being passed in variable(s) have now, need use ternary operator.

i.e.:

$username = isset($_post['password']) ? $_post['password'] : "default"; 

Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -