WxGuy1 Posted June 29, 2006 Posted June 29, 2006 (edited) I'm writing a PHP script that will read the files in a particular folder, then make individual php files for each image file (each php file will be a page that contains an image). The master script will be located under /home/[username]/public_html/events/template/ , and the individual pages and images will be contained in /home/[username]/public_html/events/$eventname/ (where $eventname is some word to describe an event). In this case, I set $eventname to "test". >// $eventname and $folder are defined previously and $username is my Cpanel username $text = "/home/{$username}/public_html/events/{$eventname}intro.html"; $eventfile = file($text); $dir = "/home/{$username}/public_html/events/{$eventname}/"; $dh = opendir($dir); while (($file = readdir($dh)) !== false) { if ($file != "." && $file != "..") { $file = substr($file,0,strlen($file)-4); $files[] = $file; } } closedir($dh); $numfiles = count($files)-2; for ($i=0; $i < numfiles; $i++) { $file = fopen("/home/{$username}/public_html/events/{$eventname}/{${files}[$i]}.php", "x"); ///LINE 34 I receive the following error (again, I removed my Cpanel username): ><b>Warning</b>: fopen(): open_basedir restriction in effect. File(/home/[username]/public_html/events/test/img_1646-01_std.php) is not within the allowed path(s): (/home2/[username]/:/usr/local/sqmail/:/usr/lib/php:/usr/local/lib/php:/tmp) in <b>/home2/[username]/public_html/events/template/makepicpages.php</b> on line <b>34</b><br /> Any help? Edited June 29, 2006 by WxGuy1 Quote
Steve Scrimpshire Posted June 29, 2006 Posted June 29, 2006 Try replacing home with home2. I see that from the path to your script: /home2/[username]/public_html/events/template/makepicpages.php Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.