|
|
 |
January 21st, 2007, 08:05 PM
|
#1
|
|
New Member
Join Date: Jun 2006
Location: usa
Age: 31
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0
|
uploading multiple files path in the database
ok i have this code that i been trying to get it to work for weeks, i want to upload multiple files and save the path in the database, PLEASE HELP
My error message is:
picture one uploadedPicture2 uploaded
Warning: Wrong parameter count for move_uploaded_file() in /home/townsfin/public_html/html_forms/insert_data. php on line 134
Code:
define ("$uploaddir", "/home/townsfin/public_html/business_images/"); $uploadfile1 = $_FILES['Picture1']['name']; if(isset ($_FILES['Picture1'])) { If (is_uploaded_file($_FILES['Picture1']['tmp_name'])&& is_uploaded_file($_FILES['Picture2']['tmp_name'])); { $fullpath1 = $uploaddir . $uploadfile1; $today=date("m-d-y"); $filename1=$_POST['name']. "1"; $result= move_uploaded_file($_FILES['Picture1']['tmp_name'], $uploaddir .$filename1); if($result==1) { echo"picture one uploaded"; } $uploadfile2= $_FILES['Picture2']['name']; $fullpath2=$uploaddir . $uploadfile2; $filename2= $_POST['name']. "2"; $result = move_uploaded_file($_FILES['Picture2']['tmp_name'], $uploaddir .$filename2); print_r($_FILES); if ($result==1) { echo"Picture2 uploaded"; } // this is the line where i have the problem if (move_uploaded_file($_FILES['Picture1']['tmp_name']. $uploaddir) && ($_FILES['Picture2']['tmp_name']. $uploaddir)) { $sql="INSERT INTO `business_info`(`BusinessName`,`Slogan`,`Business_Address`,`Tel`,`Website`,`Email`, `Fax`,`type`,`make`,`Categories`,`Keyword`,`Picture1`,`Headline`,`Slogan2`,`Description1`,`Description2`,`Description3`, `Picture2`,`Picture3`,`User_Name`,`Password`) Values('$BusinessName','$Slogan','$Business_Address','$Tel','$Website','$Email','$Fax','$type','$make','$Categories','$Keyword', '$fullpath1','$Headline','$Slogan2','$Description1', '$Description2','$Description3','$fullpath2','$fullpath1','$User_Name','$Password')"; mysql_query($sql)or die(mysql_error()); } } } ?>
|
|
|
January 22nd, 2007, 01:04 AM
|
#2
|
|
Reputable Member
Join Date: Jul 2005
Location: Melksham, Wilts, UK
Posts: 293
Thanks: 0
Thanked 0 Times in 0 Posts
|
Re: uploading multiple files path in the database
move_uploaded_file requires two parameters - a "from" and a "to". Neither is optional. You have called it with just one parameter in the line that's giving you the problem.
|
|
|
January 22nd, 2007, 12:35 PM
|
#3
|
|
New Member
Join Date: Jun 2006
Location: usa
Age: 31
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0
|
Re: uploading multiple files path in the database
ok, i think that i am telling it that it is from ($_FILES['Picture1'][tmp_name]
and it is going to fullpath1
|
|
|
January 22nd, 2007, 08:23 PM
|
#4
|
|
Reputable Member
Join Date: Jul 2005
Location: Melksham, Wilts, UK
Posts: 293
Thanks: 0
Thanked 0 Times in 0 Posts
|
Re: uploading multiple files path in the database
Quote:
Originally Posted by franknu
ok, i think that i am telling it that it is from ($_FILES['Picture1'][tmp_name]
and it is going to fullpath1
|
Perhaps your meant to use "," where you wrote "." then? (You want a comma, you have a full stop). I'm not sure it'll do exactly what you intend, but it should clear the syntax error.
|
|
|
January 23rd, 2007, 11:37 AM
|
#5
|
|
New Member
Join Date: Jun 2006
Location: usa
Age: 31
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0
|
Re: uploading multiple files path in the database
i thought about that too but when i added the coma it gaves me a syntax error it says unexpect"," and then when i remove it, it clears..
help please
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|