jamesxg1 Posted February 1, 2009 Share Posted February 1, 2009 <?php if($username == $comto) { echo("<a href='../main/DeleteComment.php'>Delete Comment</a>"); } ?> ^^ its not working it doesnt print anything Link to comment https://forums.phpfreaks.com/topic/143385-if-statment-not-working-s/ Share on other sites More sharing options...
tivrfoa Posted February 1, 2009 Share Posted February 1, 2009 so $username != $comto try use else and echo the values to debug: <?php if($username == $comto) { echo("<a href='../main/DeleteComment.php'>Delete Comment</a>"); } else { echo 'username = ' . $username . ' and comto = ' . $comto; } ?> Link to comment https://forums.phpfreaks.com/topic/143385-if-statment-not-working-s/#findComment-752071 Share on other sites More sharing options...
jamesxg1 Posted February 1, 2009 Author Share Posted February 1, 2009 so $username != $comto try use else and echo the values to debug: <?php if($username == $comto) { echo("<a href='../main/DeleteComment.php'>Delete Comment</a>"); } else { echo 'username = ' . $username . ' and comto = ' . $comto; } ?> username = jamesxg1 and comto = thats all i get :S ^^ Link to comment https://forums.phpfreaks.com/topic/143385-if-statment-not-working-s/#findComment-752074 Share on other sites More sharing options...
tivrfoa Posted February 1, 2009 Share Posted February 1, 2009 username = jamesxg1 and comto = thats all i get :S ^^ so ... what do you think you are supposed to do $comto is empty or it's not set. make var_dump($comto) after else. Link to comment https://forums.phpfreaks.com/topic/143385-if-statment-not-working-s/#findComment-752078 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.