sgs Posted February 16, 2015 Posted February 16, 2015 I'm getting a blank display in my website's main page (/index.php) but the url as the page title. Can anyone tell me, that why I'm getting a blank white display? Here is the url:http://www.sgpaste.tk/index.php (main page)http://www.sgpaste.tk/global/header.php (header.php)http://www.sgpaste.tk/global/footer.php (footer.php)
nyten Posted February 16, 2015 Posted February 16, 2015 I'm getting a "redirection error". (The site is redirecting the request in a way that it can never be finished.)
sgs Posted February 16, 2015 Author Posted February 16, 2015 You can check your .htaccess file for that reason.
Byron Posted February 16, 2015 Posted February 16, 2015 @sgs - If you posted the code of your index.php page, it would probably help.
sgs Posted February 17, 2015 Author Posted February 17, 2015 Here is the source file of index.php file:http://sgpaste.tk/src/index.php And one more thing, I'm getting the same problem with other files in the root directory.
Byron Posted February 17, 2015 Posted February 17, 2015 Seems your page is displaying an error now: http://www.sgpaste.tk/index.php
Byron Posted February 17, 2015 Posted February 17, 2015 As I write this post, I'm showing this error, which seems to come and go. Now I get the blank page and I get these headers: http://bybyron.net/2/redirect.txt A created a page in his sgpaste folder and it works fine: http://www.sgpaste.tk/admin.php I'm thinking there's a coding problem.
nyten Posted February 17, 2015 Posted February 17, 2015 I'm thinking there's a coding problem. I'm sure that header("Location: $referer"); causes the infinite redirect
sgs Posted February 17, 2015 Author Posted February 17, 2015 Now, I've found a thing in my file. When I've remove the above line:require "./global/header.php";the file (index.php) runs. Check the index.php file here: http://www.sgpaste.tk/index.php and http://www.sgpaste.tk/src/index.php (in text)and here is header.php file:http://www.sgpaste.tk/global/header.php and http://www.sgpaste.tk/src/header.php I think the problem relates with header.php
yashrs Posted February 17, 2015 Posted February 17, 2015 I think it is related to both header("Location: $referer"); and ob_start and ob_end_clean() so no output was being generated.
sgs Posted February 19, 2015 Author Posted February 19, 2015 Ok, as your suggestion, I've removed theob_start();from "header.php" and my "index.php" and others are now executing. But now I'm getting some errors.In "index.php" I'm getting the following errors:Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/sgs/public_html/sgpaste/index.php:12) in /home/sgs/public_html/sgpaste/global/header.php on line 3and the error:Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/sgs/public_html/sgpaste/index.php:12) in /home/sgs/public_html/sgpaste/global/header.php on line 3and I know that, if I remove the "session_start()" function then the problem will be omitted. But I don't want to do that because, if I do that then my project will not work. Or if I add the "ob_start()" function then the previous problem(blank display) will happen. So what to do? And in "login.php" I'm getting the following error after removing the "ob_start()" function:Warning: Cannot modify header information - headers already sent by (output started at /home/sgs/public_html/sgpaste/global/header.php:27) in /home/sgs/public_html/sgpaste/config/functions.php on line 255These errors happens where I'm using "$_SESSION/$_COOKIE/header()" please solve my problem...Here is my "functions.php" file:Source file of "functions.php": http://www.sgpaste.tk/src/functions.phpSource file of "login.php": http://www.sgpaste.tk/src/login.phpExecutable file of "login.php": http://www.sgpaste.tk/login.php
yashrs Posted February 19, 2015 Posted February 19, 2015 In login.php remove the check_cookie() function as you are not using the output (BOOL) to check whether cookies are working or not. The problem is just that your output has started and you need to execute the function session_start and the setcookie() function before the output starts. ( Include those statements before any echo statement or before outputting any data to the user. ) 1
sgs Posted February 19, 2015 Author Posted February 19, 2015 I couldn't understand clearly. Can you please fix the code and give it to me?
yashrs Posted February 19, 2015 Posted February 19, 2015 I can just help you with the basics and help you understand the problem in your code. The editing of the code and fixing the bugs needs to be done by you.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now