Selkis
Selkis

Reputation: 25

PHP !_GET displays blank page

So this is my URL:

http://myawesomesite.com/base.php?file=myawesomefile

and this is my base.php file:

          <?php

if (is_file("$_GET["file"].inc.php")) include ("$_GET["file"].inc.php");
else include("homepage.inc.php");

?>

This results in a blank page. What am I doing wrong?

Thanks in advance. Cheers!

Upvotes: 1

Views: 74

Answers (1)

Loko
Loko

Reputation: 6679

You're using double quotes in the is_file() function and in the $_GET variable. They're in eachothers way.

Use this:

if (is_file("$_GET['file'].inc.php")) include ("$_GET['file'].inc.php");

Al though I'm not sure but what you have right now should give back an error and not a blank page.

Upvotes: 5

Related Questions