MySQL Forums
Forum List  »  PHP

uploading files
Posted by: Reham G
Date: July 11, 2005 02:48PM

hi alllll,
i've made a form which attach files but it works incorrectly....i want it to attach file after file like that of hotmail 'ok and attach another'.........plz help f1 f1!!!!!!!

here it is

<?

$ImgStr=$_REQUEST["ImgStr"];

if ($_FILES['Img']['tmp_name'])
{
$uploaddir = 'userimage/';
$uploadfile =$_FILES['Img']['name'];
if (move_uploaded_file($_FILES['Img']['tmp_name'],$uploaddir.$uploadfile))
{

if($ImgStr=="")
$ImgStr=$uploadfile;
else
$ImgStr.=";".$uploadfile;
}

}
?>




<form enctype="multipart/form-data" action="<?echo $_SERVER['PHP_SELF'];?>" method="post">

<input type="hidden" name="ImgStr" value="<?echo $ImgStr;?>" >
<input type="hidden" name="MAX_FILE_SIZE" value="30000" />
<input name="Img" type="file" />
<input type="submit" value="Ok & Attach another" />
</form>




<?
if($ImgStr!="")
{

$att=split(";",$ImgStr);

for($i=0;$i<sizeof($att);$i++)
{

echo $att[$i]."<br>";
}//next

}//end if
?>

Options: ReplyQuote


Subject
Written By
Posted
uploading files
July 11, 2005 02:48PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.