Submit Your Article Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > PHP

Reply
 
LinkBack Thread Tools
Old 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 franknu is on a distinguished road
Exclamation 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";
$resultmove_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());
}
}
}
?> 
franknu is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old 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
Rep Altering Power: 0 grahame is a jewel in the rough grahame is a jewel in the rough grahame is a jewel in the rough
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.
grahame is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old 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 franknu is on a distinguished road
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
franknu is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old 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
Rep Altering Power: 0 grahame is a jewel in the rough grahame is a jewel in the rough grahame is a jewel in the rough
Re: uploading multiple files path in the database

Quote:
Originally Posted by franknu View Post
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.
grahame is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old 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 franknu is on a distinguished road
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
franknu is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks

Tags
multiple files upload


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
uploading files Phixon Flash and ActionScript 3 November 14th, 2007 07:43 AM
uploading files ziggi PHP 8 May 30th, 2007 04:16 PM
Microsoft JET Database Engine path error bean_2k1 Databases 3 January 26th, 2007 03:49 AM
files not uploading skyfire400 Web Hosting and Domains 1 March 4th, 2006 02:30 PM
Uploading of files gwx03 Implemented Suggestions 6 December 24th, 2003 05:51 PM


Search Engine Optimization by vBSEO 3.2.0 RC8