Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Unable to upload image.......using file element....please help.
Old 02-23-2010, 02:18 AM Unable to upload image.......using file element....please help.
Isabella_Smith's Avatar
Ultra Talker

Posts: 285
Trades: 0
Hi,

I am making a user feedback form and I've to ask for a image for that......so I am using file element but its not saving anything in the database in the field I've made for that......

Here's the more info....

This is how I've defined file element.

PHP Code:
<input name="file" id="file" class="ftextbox1" tabindex="6" type="file"
Here's I am using inside my filese...
PHP Code:
$fbimg $userfback->upload_file_art($_FILES['file'],"../img/uimg/"); 
Here's the function upload_file_art

PHP Code:
function upload_file_art($file$path)
    {    
        
$filename rand(1000,9999)."_".$file["name"];
        
$tempName $file["tmp_name"];
        
$UPLOAD_FILE =  $path."/".$filename;    
        
$target $path."thumb/";
        
$new_w 41;
        
$new_h 46
        
ini_set('memory_limit''50M');
        if(
$tempName){
            
//system("chmod 7777 $UPLOAD_FILE");
            
if(move_uploaded_file($tempName$UPLOAD_FILE))
            {
                
$this->createthumb($filename,$path,$target,$new_w,$new_h);
                return  
$filename;
            }
            else
                return 
false;
        }
        else{
            return 
false;
        }
    } 
And the last but not least saving it into database...
PHP Code:
"insert into tblfback(`fb_photo') values('$fbimg')";
$result_add  mysql_query($sql_add);
 return 
true;
    } 
Please let me know if what's wrong with it.

Thanks in advance.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE
buy all indian salwar Kameez, Sarees and clothes
Isabella_Smith is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-23-2010, 03:56 AM Re: Unable to upload image.......using file element....please help.
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Individually, they are all right.
Now, what is important is how you put them together.

And what if your first step was to check that the query is executed ?
The second could be to check the return of mysql_query, to see if there was an error.

Just a pointer for the second step: mysql_error()
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 02-24-2010, 01:55 AM Re: Unable to upload image.......using file element....please help.
Isabella_Smith's Avatar
Ultra Talker

Posts: 285
Trades: 0
Thanks tripy, I'll check.

just for the info, the form is working pefectly....but not taking the image name...in database field.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE
buy all indian salwar Kameez, Sarees and clothes

Last edited by Isabella_Smith; 02-24-2010 at 04:15 AM..
Isabella_Smith is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Unable to upload image.......using file element....please help.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.54286 seconds with 12 queries