need help getting include script to work with PHP5 - Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Webmaster Tech > Programming > PHP Development

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 06-21-2009, 11:24 AM   #1 (permalink)
Junior Member
 
Join Date: Apr 2009
Posts: 42
Default need help getting include script to work with PHP5

I'm working on a new site and i'm not very good with php at all. i only know the basics, and the include script i use was written by an old friend years ago. now that im using php5, the include script doesnt work. the error message doesn't even pop up. here is the script, so hopefully someone here can help

PHP Code:
<?php

$abspath = ".";
$extension = "txt";
$defaultfile = "default.txt";
$errorfile = "404.txt";
$query = "barrel";


clearstatcache();
$includestring = "";
$mainpage = urldecode($$query);
$mainstring = $abspath."/".$mainpage.".".$extension;
if (!$mainpage) {
$includestring = $abspath."/".$defaultfile;
} elseif (ereg("\.\.", $mainpage) || substr($mainpage,0,2) == "./" || substr($mainpage,0,3) == "../") {
die("Screw off.");
} else {
if (file_exists($mainstring) && is_file($mainstring)) {
$includestring = $mainstring;
} else {
$includestring = $abspath."/".$errorfile;
}
}
@include($includestring);

?>
------------------------
Acai Berry Juice Health Juice Berries Benefits Teaching Children with Autism Program Poems Behavior Treatment Center
afslanken
halia123 is offline   Reply With Quote
Sponsored Links
Old 06-25-2009, 06:18 PM   #2 (permalink)
Junior Member
 
Join Date: Jun 2009
Posts: 4
Default Re: need help getting include script to work with PHP5

i'm actually not sure, try running it without the @ infront of include then it should give you an error message
orion is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Sponsors

» Links

» Affiliates
Web Hosting
Online Backup Reviews
Marketing Find
Merchant Select
SiteMap Builder
Host Compare

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 08:53 AM.


Powered by vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.2
Webmaster Forums
Web Hosting | Chicago Web Hosting | Web Hosting