acid.waste Posted October 27, 2010 Share Posted October 27, 2010 Alrite, i have a configs.php that holds a bunch of information (Login info mostly) and when i do $UsrNme = $_POST["user"]; $Passw = $_POST["pass"]; include 'configs.php' if ($UsrNme == $UserName && $Passw == $Password) { setcookie("User", "True", time()+3600); echo "Welcome {$UsrNme}; You have been successfully logged in!"; } else { echo "Sorry, the username {$UsrNme} was not successfully logged in."; } It prints my configs.php instead of using the variables $UserName and $Password to check against UsrNme and Passw... Am i doing something wrong or is this supposed to happen? Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted October 27, 2010 Share Posted October 27, 2010 Hard to tell without knowing what's in configs.php. Quote Link to comment Share on other sites More sharing options...
acid.waste Posted October 27, 2010 Author Share Posted October 27, 2010 config.php has $UserName = "Username"; $Password = "Password"; $AdminEmail = "admin@lol.net"; $sqlHOST = "host.host.host"; $sqlUser = "username"; $sqlPass = "Password"; $sqlDatabase = "database"; $ForumName = "Test"; $ForumName = "http://www.lol.com/forum/"; Quote Link to comment Share on other sites More sharing options...
freelance84 Posted October 27, 2010 Share Posted October 27, 2010 There is no semi colon after include 'configs.php', that may be messing things up a bit Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted October 27, 2010 Share Posted October 27, 2010 does config.php have opening and closing php tags? Quote Link to comment Share on other sites More sharing options...
rwwd Posted October 27, 2010 Share Posted October 27, 2010 It will print out the contents if you don't wrap the file in php tags - either that or you left them off the post? And in your first example your missing the ; from the include instruction. Rw Quote Link to comment Share on other sites More sharing options...
acid.waste Posted October 27, 2010 Author Share Posted October 27, 2010 Thanks for your help everyone! I forgot to have fwrite add the opening and closing php tags, thanks for helping me see this! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.