Hep in php ??

Discussion in 'PHP' started by mahiraj, Oct 29, 2007.

  1. #1
    Hi All,

    I want to upload image through a form into a database.

    In form i have a brows button i am selecting the image from that place, but when i submit this one all path like as "c:/images/first.jpg" goes to the database table but i want only the name of the image "first.jpg" should go into the database how will i remove the rest path ????
    please help to do this

    THANKS..
     
    mahiraj, Oct 29, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    www.php.net/basename

    However, are you sure you're using $_FILES['userfile']['name'] and not $_FILES['userfile']['tmp_name']??
     
    nico_swd, Oct 29, 2007 IP