Jump to content

Include error


WatsonN

Recommended Posts

I'm working on a script that will include diffrent files based on the url query. But I'm getting an error saying

Warning: include(Lyrics/Sugarland/All%20I%20Want%20To%20Do.php) [function.include]: failed to open stream: No such file or directory in /home/content/n/a/t/nathanwatson/html/Lyrics/index.php on line 18

 

Warning: include() [function.include]: Failed opening 'Lyrics/Sugarland/All%20I%20Want%20To%20Do.php' for inclusion (include_path='.:/usr/local/php5/lib/php') in /home/content/n/a/t/nathanwatson/html/Lyrics/index.php on line 18

Here is the code:

<?php
$url = (isset($_GET['p']) ? $_GET['p'] : home);
?>
ID: <?= $url ?>

<?php
$s1 = "AIWTD-Sugarland" ;
$s2 = "LM-MontgomeryGentry" ;
$s3 = "TML-JeremyCamp" ;
$home = "home.php" ;
$l1 = "Lyrics/Sugarland/All%20I%20Want%20To%20Do.php" ;
$l2 = "Lyrics/Montgomery%20Gentry/Lucky%20Man.php" ;
$l3 = "Lyrics/Jeremy%20Camp/Take%20My%20Life.php" ;
?>

<?php
if ($url == 'AIWTD-Sugarland') {
    include($l1);
} elseif ($url == 'LM-MontgomeryGentry') {
    include($l2);
} elseif ($url == 'TML-JeremyCamp') {
    include($l3);
} else  {
include('home.php');
}
?>

 

So what I'm asking is what could be causing this error.

 

Thanks in advanced  :)

Link to comment
https://forums.phpfreaks.com/topic/201933-include-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.