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

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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....

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.