ayaya Posted February 9, 2013 Share Posted February 9, 2013 can anyone tell me what's wrong with this code? if (isset($_POST['id']=='admin')) {... } why it displays "syntax error, expecting ',' or')' ? if i want to know if the id=admin, how should I do? Link to comment https://forums.phpfreaks.com/topic/274274-how-to-use-isset/ Share on other sites More sharing options...
Jessica Posted February 9, 2013 Share Posted February 9, 2013 isset() just tells you if it exists and is set. You then compare the variable to the value you want to check as a separate evaluation. Link to comment https://forums.phpfreaks.com/topic/274274-how-to-use-isset/#findComment-1411401 Share on other sites More sharing options...
denno020 Posted February 9, 2013 Share Posted February 9, 2013 So what you want to do is separate your if conditions if(isset($_POST['id']) && $_POST['id'] == "admin"){} Denno Link to comment https://forums.phpfreaks.com/topic/274274-how-to-use-isset/#findComment-1411406 Share on other sites More sharing options...
ayaya Posted February 10, 2013 Author Share Posted February 10, 2013 Thank you very much!!! Link to comment https://forums.phpfreaks.com/topic/274274-how-to-use-isset/#findComment-1411514 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.