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!
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.