We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,571 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

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

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";
}
}
?>
3
Contributors
1
Reply
4 Hours
Discussion Span
1 Year Ago
Last Updated
2
Views
Question
Answered
megachip04
Light Poster
34 posts since Jul 2011
Reputation Points: 10
Solved Threads: 1
Skill Endorsements: 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.

Insensus
Junior Poster
112 posts since Mar 2011
Reputation Points: 70
Solved Threads: 46
Skill Endorsements: 0
Question Answered as of 1 Year Ago by Insensus

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page generated in 0.0877 seconds using 2.7MB