having error in uploading photo

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    having error in uploading photo

    i am having a problem with photo uploading - here is the code

    Code:
    $photo_type = substr($_FILES['photo']['type'], 6);
    $sql = mysql_query("UPDATE `chat_users` SET `photo` = '".$photo_type."' WHERE `id` = '".$id."';");
        if(copy($_FILES['photo']['tmp_name'], "photos/".$id.".".$photo_type.""))
        {
        echo "Photo Uploaded Successfully<br/>";
    everything goes ok as like as photo copied in the photos folder including all the other things.

    but in sql chat users in photo field it only update the type of the photo for example gif or jpeg it won't update the full url like for example coding-talk.com/photos/1.gif?23232

    can somebody help me !

    #2
    Originally posted by bijaybd View Post
    i am having a problem with photo uploading - here is the code

    Code:
    $photo_type = substr($_FILES['photo']['type'], 6);
    $sql = mysql_query("UPDATE `chat_users` SET `photo` = '".$photo_type."' WHERE `id` = '".$id."';");
        if(copy($_FILES['photo']['tmp_name'], "photos/".$id.".".$photo_type.""))
        {
        echo "Photo Uploaded Successfully<br/>";
    everything goes ok as like as photo copied in the photos folder including all the other things.

    but in sql chat users in photo field it only update the type of the photo for example gif or jpeg it won't update the full url like for example coding-talk.com/photos/1.gif?23232

    can somebody help me !
    PHP Code:
    $sql mysql_query("UPDATE `chat_users` SET `photo` = 'photos/".$id.".".$photo_type."' WHERE `id` = '".$id."';"); 

    Comment


      #3
      hey thanks bro its working fine many many thanks to you for the great help !

      Comment

      Working...
      X