Re: Copy () Error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It is a mistake of leave, the folder in which you want to copy the file is not writable
   
          I need the following code:

copy() error: warning(): no such files or directores. 

echo $filename1 (this variable is correct display the path)
echo $filename2(this also correct display the path)
BUT
copy($filename1,$filename2); this line is error. 
Please help me

<?php
require('Commonfile.php');
$filename = "template/temp".$_REQUEST['TempID']."/index".$_REQUEST['TempID'].".php";
$res = fopen($filename,"r");
$contents = fread($res, filesize($filename));
$strSelect = "select * from tbl_register where IRegisterID=".$_REQUEST['TempID'];
$result = mysql_query($strSelect);
$rows = mysql_fetch_object($result);
$dir = $rows->TName;
$file = $dir."/index.php";
$somecontent = $contents;
//$filename1 = "fundspin/fundspin_blog/template/temp".$_REQUEST['TempID']."/img/";
//$filename2 = "fundspin/fundspin_blog/".$dir;
copy($filename1,$filename2);
// Let's make sure the file exists and is writable first.
$handle = fopen($file, 'a');
$dirfile = "$dir/img";
mkdir($dirfile);
//copy("http://localhost/fundspin/fundspin_blog/template/temp1/img/","http://localhost/fundspin/fundspin_blog/$dirfile";);
fwrite($handle, $somecontent);
fclose($res);
header("Location: $file");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd";>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="frmtemplate" action="ourTemplate.php" method="post" enctype="multipart/form-data">
</form>
</body>
</html>

---------------------------------
Share files, take polls, and make new friends - all under one roof. Click here.

[Non-text portions of this message have been removed]



                           

       
---------------------------------

Yahoo! Encuentros
Ahora encontrar pareja es mucho más fácil, probá el nuevo Yahoo! Encuentros.
 Visitá http://yahoo.cupidovirtual.com/servlet/NewRegistration

[Non-text portions of this message have been removed]


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux