Results 1 to 6 of 6

Thread: php image

  1. #1
    Join Date
    Aug 2009
    Posts
    74
    Thanks
    7
    Thanked 1 Time in 1 Post

    Default php image

    i can upload image but wht my problem is if there are any gaps between the name of image (ex:summer hiils.jpeg) it is not showing the image when iam calling from database, the other names works properly like(me.jpeg,single.jpeg) please help me out as quick ac possibile


    2) when i uploaded my site on server iam getting a error at the end of page
    --------------------------------------------------------
    Error in my_thread_global_end(): 1 threads didn't exit
    ----------------------------------------------------------

    how to solve it. URGENT PLEASE

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    In the database try this:
    summber%20hiils.jpeg

    Good luck
    Jeremy | jfein.net

  3. #3
    Join Date
    Aug 2009
    Posts
    74
    Thanks
    7
    Thanked 1 Time in 1 Post

    Default

    that is possible ,wht if my uploading file name is having gaps

  4. #4
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    557
    Thanks
    8
    Thanked 66 Times in 66 Posts

    Default

    you can rename your file in both the database and the actual file itself, by replacing spaces " " with underscores "_". I do that myself.

    For example, after uploading the file, use rename to rename file:
    PHP Code:
    $file $_POST['file'];

    rename($filestr_replace(" ""_"$file)); 
    und when uploading to the database, do the same:
    PHP Code:

    $_POST
    ['file'];
    $newImg str_replace(" ""_"$_POST['file']);

    mysql_query("INSERT INTO images (img) VALUES('$newImg') ") or die(mysql_error()); 
    - Josh

  5. #5
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    What do you mean "gaps?" Replace all of the spaces with %20. For example:
    hi ,.php
    Turns to:
    hi%20%20.php
    Jeremy | jfein.net

  6. #6
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    557
    Thanks
    8
    Thanked 66 Times in 66 Posts

    Default

    She means when she's uploading, the file name that gets inputted into the database has spaces. But like said before, you can avoid that by replacing spaces w/underscores. [better].

    Now, if you want a much faster solution to the problem, you can just replace spaces w/%20 when calling the file from the database.
    - Josh

Bookmarks

Posting Permissions

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