Welcome to Discuss Everything Forums...

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.


 

Tags for this Thread

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Aswin K's Avatar
    Junior Member

    Status
    Offline
    Join Date
    Sep 2009
    Posts
    6
    Downloads
    0
    Uploads
    0

    insert image into database using php?

    How to insert image (jpeg/gif/bmp) into database from form into database using php.
    Help me

  2. #2
    Vinay's Avatar
    Newbie - NLP

    Status
    Offline
    Join Date
    Apr 2009
    Posts
    25
    Downloads
    0
    Uploads
    0
    Put this code in action file
    and $userprofiles_photopath = your photo folder path.


    $userprofiles_photopath = $_POST['userprofiles_photopath_hidden'];
    if($userprofiles_photopath == '')
    {
    if($_FILES['userprofiles_photopath']['name'] != '')
    {
    $userprofiles_photopath = '../userphotos' . '/' . $_FILES['userprofiles_photopath']['name'];
    $tmp_name=$_FILES['userprofiles_photopath']['tmp_name'];
    move_uploaded_file($tmp_name, $userprofiles_photopath);
    }
    }

    and in form you add this code

    <form name="" id="" enctype='multipart/form-data'>

    </form>

  3. #3
    Vinay's Avatar
    Newbie - NLP

    Status
    Offline
    Join Date
    Apr 2009
    Posts
    25
    Downloads
    0
    Uploads
    0
    Put this code in action file
    and $userprofiles_photopath = your photo folder path.


    $userprofiles_photopath = $_POST['userprofiles_photopath_hidden'];
    if($userprofiles_photopath == '')
    {
    if($_FILES['userprofiles_photopath']['name'] != '')
    {
    $userprofiles_photopath = '../userphotos' . '/' . $_FILES['userprofiles_photopath']['name'];
    $tmp_name=$_FILES['userprofiles_photopath']['tmp_name'];
    move_uploaded_file($tmp_name, $userprofiles_photopath);
    }
    }

    and in form you add this code

    <form name="" id="" enctype='multipart/form-data'>

    </form>

 

 

Quick Reply Quick Reply

Click here to log in


What color is our footer?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 03-09-2011, 06:37 AM
  2. PHP/MySQL: Cannot insert my data in database :c?
    By Reann in forum Discuss PHP
    Replies: 0
    Last Post: 12-05-2010, 04:41 AM
  3. Replies: 0
    Last Post: 12-09-2009, 12:04 AM
  4. how to insert an image to a database using OleDbCommand C#?
    By Heartless in forum Ælternate Reality - The PhotoChop Shop
    Replies: 0
    Last Post: 10-05-2009, 04:34 AM
  5. php- i cannot insert data into database?
    By sarahshafawati in forum Discuss PHP
    Replies: 0
    Last Post: 07-14-2009, 11:04 PM

Bookmarks

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •