Jump to content

[SOLVED] can anyone help on this function please


watthehell

Recommended Posts

can anyone help on this function please

 

function UploadFile($filen,$filepath)
{

if(!move_uploaded_file($_FILES[$filen]["tmp_name"],$filepath))
{
echo"Could not copy file";
exit;
}

 

What is $filen and $filepath here...

 

i write like this

 

$strfilepathgif=UploadFile("txtimagegif","animatedgif");

 

is this ok

 

a) nothing to do with OOP (moved)

b) you have enough here for the manual to be of assistance. http://www.php.net/move_uploaded_file

c) you havent said if anything is wrong or if you got any errors

d) in answer to your question "Is this ok?" then the answer is simple: if it works, yes it's ok. if it doesnt work, no it's not.

 

 

Please explain yourself much more clearly giving all the information/errors/issues you have.

so sweet i really loved it.. thanks

 

a) nothing to do with OOP (moved)

for this i thought this function was inside a class so i thought it was OOP

 

b) you have enough here for the manual to be of assistance. http://www.php.net/move_uploaded_file

this didnt solved my problem

 

c) you havent said if anything is wrong or if you got any errors

my error is like this

Warning: move_uploaded_file(../animatedgif) [function.move-uploaded-file]: failed to open stream: Permission denied in c:\wamp\www\myfile\admin\addtest.php on line 123

 

d) in answer to your question "Is this ok?" then the answer is simple: if it works, yes it's ok. if it doesnt work, no it's not.

IT did not work so it is not ok....

 

my code is like this

 

if($frfilenamegif!="" && $imageErrorFlag==false)
	{
		$strfilepath=move_uploaded_file($_FILES["txtimagegif"]["tmp_name"],"../animatedgif");
		$strfile=$strfilepath;

		if($strfilepath==-1)
			{
				$lblmsg=" Image isn't in proper size.";
				$imageErrorFlag1=true;
				$strfile="";
			}
		}

 

it shows the error i posted above

 

can anybody help please....

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.