WatsonN Posted May 16, 2010 Share Posted May 16, 2010 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 More sharing options...
Sudantha Posted May 16, 2010 Share Posted May 16, 2010 double check ur file path also why using % as hierarchy separates Link to comment https://forums.phpfreaks.com/topic/201933-include-error/#findComment-1059042 Share on other sites More sharing options...
WatsonN Posted May 16, 2010 Author Share Posted May 16, 2010 The path files were fine. The %20 were from when I made the file origonaly instead of using -. That is what solved it was changing the hierarchy separates. Thank Ya Much! Link to comment https://forums.phpfreaks.com/topic/201933-include-error/#findComment-1059044 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.