McBryver Posted February 25, 2011 Share Posted February 25, 2011 Hello everyone, When I submit my login form to go to my login page it goes to a white page and does not display an error. <?php include("../secure/database.php"); if(!empty($_POST['loginsubmit'])){ if(!empty($_POST['email'])){ $email = securevar($_POST['email']); if(!empty($_POST['passconf'])){ $pass = securevar($_POST['passconf']); $q = "SELECT * FROM `accountinfo_db` WHERE `email` = '$email' AND `password` = '$pass'"; $res = mysql_query($q) or die(mysql_error()); $login = mysql_fetch_array($res); $id = $login['id']; $active = $login['active']; if($id>=1){ if($active==1){ $_SESSION['logged'] = $login['id']; $q = "UPDATE `accountinfo_db` SET `loggedtimes` = `loggedtimes`+'1' WHERE `id` = '$id'"; $res = mysql_query($q) or die(mysql_error()); $user = $login['username']; header("Location: ../mainframe.php?strmsg=Welcome Back $user"); }else{ header("Location: activate.php"); } }else{ header("Location: ../index.php?strmsg=Login Information Incorrect!"); } }else{ header("Location: ../index.php?strmsg=You did not enter a valid password!"); } }else{ header("Location: ../index.php?strmsg=You did not enter a valid email!"); } }else{ header("Location: ../index.php?strmsg=We are sorry but you are not allowed viewance of that directory!"); } ?> any help would be great. Brian Quote Link to comment https://forums.phpfreaks.com/topic/228752-login-code-displaying-only-blank-white-page-no-error/ Share on other sites More sharing options...
Pikachu2000 Posted February 25, 2011 Share Posted February 25, 2011 Do you have error reporting on in your php.ini file? Have you inserted some echos into that code to see what it's actually doing? Quote Link to comment https://forums.phpfreaks.com/topic/228752-login-code-displaying-only-blank-white-page-no-error/#findComment-1179368 Share on other sites More sharing options...
McBryver Posted February 25, 2011 Author Share Posted February 25, 2011 I am using some sort of free hosting so I do not have access to the php.ini file and I have tried to echo and die the data but it does not display anything, also it works fine on my xampp local testing server but not on the hosting. I think I might need to find some other hosting service. Does anyone know of a good free hosting service with instant activation and usage? Thank you for the help, Brian Quote Link to comment https://forums.phpfreaks.com/topic/228752-login-code-displaying-only-blank-white-page-no-error/#findComment-1179374 Share on other sites More sharing options...
PFMaBiSmAd Posted February 25, 2011 Share Posted February 25, 2011 Whatever is causing the code to not work, won't change by jumping to a different host. You must find and fix whatever is causing the problem. A) What do you get when you do a 'view source' of the blank page in your browser? B) You can normally use a LOCAL php.ini. Have you checked the host's FAQ section at all to find out if you can use a local php,ini (sometimes it is named differently.) C) Can you even put in a simple echo 'page requested'; statement at the start of your code, before any of the conditional statements and get the 'page requested' output? D) It would help if you posted all the relevant code. For example, suppose there is something wrong with your form and it doesn't submit anything on the live server or your database.php file is dieing with no output/error messages? Quote Link to comment https://forums.phpfreaks.com/topic/228752-login-code-displaying-only-blank-white-page-no-error/#findComment-1179376 Share on other sites More sharing options...
joshbedo Posted February 25, 2011 Share Posted February 25, 2011 I'm pretty sure it has something to do with securevar I'm guessing your include has the wrong path I would try setting a variable in your included file and see if you can echo the variable before you have the securevar function. Quote Link to comment https://forums.phpfreaks.com/topic/228752-login-code-displaying-only-blank-white-page-no-error/#findComment-1179379 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.