Page 1 of 1

My $_GET is giving blank page

Posted: Thu Aug 17, 2017 6:48 am
by WorldCom
Everything on the site has been working fine until the other day.
As simple passing of a variable is now giving me WSOD.

I'm calling a second page with something like page_details.php?id=2
Now I'm getting a white screen.
When I check the page just calling it directly: page_details.php and I add inside the page <?php $id=2 ?>, the page displays what it is suppose to.
This is just on the client side for people to view information.

In my admin panel I have the same problem but have done a work around.

This gives a blank screen:

Code: Select all

echo "<a href='edit_booking.php?id=$id'>$name</a>";
This works using a POST function instead of GET:

Code: Select all

echo "<form action='edit_booking.php' method='post'>";
echo "<input type='hidden' name='id' value='$id'><input type='submit' value='$name'></form>";
This is on the receiving page:

Code: Select all

if( isset($_GET['id']) ){
	$id = (int)$_GET['id'];
	} else {
	$id = (int)$_POST['id'];
}
I know that my code when I did this site is a bit outdated but the database is being accessed fine, and any queries seem to work.
Also, have other sites on this same server and the GET queries are working fine. It's only happening on this one site.

Thanks for any help.
:banghead:

Quick update:
Stripped out all of the code from the page and it still goes blank. Anytime I call a php page with php_page.php?id=2, its blank.
This must be a server side issue????

There is one other strange thing. I have a mysterious number 1 at the bottom of my pages. No idea how it gets there.

Re: My $_GET is giving blank page

Posted: Thu Aug 17, 2017 9:06 am
by requinix
What does your error log say?

Re: My $_GET is giving blank page

Posted: Thu Aug 17, 2017 12:52 pm
by WorldCom
requinix wrote:What does your error log say?
Heres a small segment of what I could find.

99.248.105.57 - - [17/Aug/2017:08:32:37 -0400] "GET /cottage_details.php?id=35 HTTP/1.1" 200 - "http://www.beachsidecottages.com/menu.htm" "Mozilla/5.0 (Windows NT 6.1; rv:55.0) Gecko/20100101 Firefox/55.0"
207.46.13.95

Re: My $_GET is giving blank page

Posted: Thu Aug 17, 2017 3:08 pm
by requinix
That is the access log, not the error log.

Re: My $_GET is giving blank page

Posted: Fri Aug 18, 2017 3:51 am
by WorldCom
I'm using cPanel and when I look at the error log for the last 300 errors, it shows nothing.
I've put a support ticket in. Hopefully they can sort it out. I though it may have been something I'm doing, but it must be on the server.

Re: My $_GET is giving blank page

Posted: Fri Aug 18, 2017 5:10 am
by requinix
edit: Ignore that.

I think I see where this is going wrong.

1. What is the code in your config.php?
2. Add these two lines in your .htaccess just above the RewriteRule:

Code: Select all

RewriteCond %{REQUEST_FILENAME} \.php$
RewriteCond %{REQUEST_FILENAME} -f

Re: My $_GET is giving blank page

Posted: Fri Aug 18, 2017 12:12 pm
by WorldCom
It was my .htaccess file. I'm not sure how it got changed, but that was causing the problems. Thanks for all the help.

Re: My $_GET is giving blank page

Posted: Fri Aug 18, 2017 12:38 pm
by requinix
Files don't just change spontaneously. You need to find out when and why it happened.