1,105,332 Community Members

Warning: copy() [function.copy]: open_basedir restriction in effect

Member Avatar
megachip04
Light Poster
34 posts since Jul 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

Warning: copy() [function.copy]: open_basedir restriction in effect. File() is not within the allowed path(s): (/home/oeaivcom:/usr/lib/php:/usr/local/lib/php:/tmp)

I am trying to create a form that someone can submit a file to an ftp location. I found a script online and it is giving me this error. Could anyone point me in the right direction? I have set the permission code of user_submissions to 777. /public_html is inside /home/oeaiv

FORM

<form id="form1" name="form1" method="post" action="enter_check.php">
<input name="ufile[]" type="file" id="ufile[]" size="25" />
</form>

ENTER_CHECK.PHP

<?php

include("db_config.php");

$tbl_name="usernames";

$path1= "public_html/fsg/user_submissions".$HTTP_POST_FILES['ufile']['name'];

if($ufile !=none)
{
if(copy($HTTP_POST_FILES['ufile']['tmp_name'], $path))
{
echo "Successful<BR/>";
echo "File Name :".$HTTP_POST_FILES['ufile']['name']."<BR/>"; 
echo "File Size :".$HTTP_POST_FILES['ufile']['size']."<BR/>"; 
echo "File Type :".$HTTP_POST_FILES['ufile']['type']."<BR/>"; 
echo "<img src=\"$path\" width=\"150\" height=\"150\">";
}
else
{
echo "Error";
}
}
?>
Member Avatar
Insensus
Junior Poster
112 posts since Mar 2011
Reputation Points: 52 [?]
Q&As Helped to Solve: 46 [?]
Skill Endorsements: 0 [?]
 
0
 

At line 7 you specify the variable $path1 but in the copy function on line 11 you use $path which is undefined.
This produces the error.

Question Answered as of 2 Years Ago by Insensus
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: