+ Reply to Thread
Page 2 of 16
FirstFirst 1 2 3 4 12 ... LastLast
Results 11 to 20 of 158

Thread: Tutorial: Storing Images in MySQL with PHP / Part II / Display your images

  1. #11
    Moderator Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan's Avatar
    Join Date
    Dec 2006
    Location
    Estonia
    Age
    18
    Posts
    2,065
    Blog Entries
    9

    Re: Tutorial: Storing Images in MySQL with PHP / Part II / Display your images

    yea you should show the script.. then we can solve the problem
    Trill Hosting - Cheap SSL, Cheap Web Hosting, Register Cheap Domains, Cheap Blog Hosting
    www.trillhosting.com | support@trillhosting.com
    Hosting Plans | Write To Us | Support | Client Area | About Us

    CodeCall Blog | CodeCall Wiki

  2. #12
    Newbie coated_pill is an unknown quantity at this point
    Join Date
    Jul 2008
    Posts
    12

    Re: Tutorial: Storing Images in MySQL with PHP / Part II / Display your images

    i have solved the corrupt problem.. i just wanna ask if what will i place in the tags of files extension to uploads .zip or .rar in my webhost..

    what will i replace with this tags
    # What type of files should be allowed to be uploaded ?
    $allow_type = "audio/mpeg";
    Last edited by coated_pill; 07-11-2008 at 05:46 AM.

  3. #13
    Moderator Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan's Avatar
    Join Date
    Dec 2006
    Location
    Estonia
    Age
    18
    Posts
    2,065
    Blog Entries
    9

    Re: Tutorial: Storing Images in MySQL with PHP / Part II / Display your images

    Code:
    // .rar
    $allow_type "application/rar";
    // .zip
    $allow_type "application/zip"
    I get those by using this script:

    Code:

    <?php
    if($_GET['act'] == "show"){
    echo 
    $_FILES['files']['type'];
    }else{
    ?>

    <form action="?act=show" enctype="multipart/form-data" method="post">
    <input type="file" name="files" />
    <input type="submit" name="submit" />
    </form>
    <?php
    }
    ?>
    Trill Hosting - Cheap SSL, Cheap Web Hosting, Register Cheap Domains, Cheap Blog Hosting
    www.trillhosting.com | support@trillhosting.com
    Hosting Plans | Write To Us | Support | Client Area | About Us

    CodeCall Blog | CodeCall Wiki

  4. #14
    Newbie coated_pill is an unknown quantity at this point
    Join Date
    Jul 2008
    Posts
    12

    Re: Tutorial: Storing Images in MySQL with PHP / Part II / Display your images

    Quote Originally Posted by Jaan View Post
    Code:
    // .rar
    $allow_type "application/rar";
    // .zip
    $allow_type "application/zip"
    I get those by using this script:

    Code:

    <?php
    if($_GET['act'] == "show"){
    echo 
    $_FILES['files']['type'];
    }else{
    ?>

    <form action="?act=show" enctype="multipart/form-data" method="post">
    <input type="file" name="files" />
    <input type="submit" name="submit" />
    </form>
    <?php
    }
    ?>
    by the way.. can i have a very detailed tutorials on how can i upload my files to my sub folder in my public_html folder..

    A step step by step to do this with the explanation and example.. that would be highly appreciated.. thanks! i am just a newbie in php..

    Thank you again!

  5. #15
    Newbie coated_pill is an unknown quantity at this point
    Join Date
    Jul 2008
    Posts
    12

    Re: Tutorial: Storing Images in MySQL with PHP / Part II / Display your images

    Resolved ^_^

  6. #16
    -z-
    -z- is offline
    Newbie -z- is an unknown quantity at this point
    Join Date
    Jul 2008
    Posts
    1

    Re: Tutorial: Storing Images in MySQL with PHP / Part II / Display your images

    hi.. i have modified the code because i did not pass the id from other page.. an while i run the page .. it will call me to download the php file...pls advice .. i just want to retrieve the picture stored in the database and it is uploaded sucessfully from the previous tutorial provided.. thanks in advance

    Code:
     $storedid = "1";
      $id = (int)$storedid;
    
    if(!isset($id) || empty($id)){
    die("Please select your image!");
    }else{
    
    $query = mysql_query("SELECT * FROM tbl_images WHERE id='$id'");
    $row = mysql_fetch_array($query);
    $content = $row['image'];

  7. #17
    Newbie Stucka is an unknown quantity at this point
    Join Date
    Aug 2008
    Posts
    1

    Re: Tutorial: Storing Images in MySQL with PHP / Part II / Display your images

    Thank you

  8. #18
    Programmer techker is an unknown quantity at this point
    Join Date
    Aug 2008
    Location
    mtl
    Posts
    136

    Re: Tutorial: Storing Images in MySQL with PHP / Part II / Display your images

    why is that i get a download file when i call it in the browser?

    viewimage.php?id=1

  9. #19
    Moderator Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan is a splendid one to behold Jaan's Avatar
    Join Date
    Dec 2006
    Location
    Estonia
    Age
    18
    Posts
    2,065
    Blog Entries
    9

    Re: Tutorial: Storing Images in MySQL with PHP / Part II / Display your images

    hmm.. have you changed anything?
    Trill Hosting - Cheap SSL, Cheap Web Hosting, Register Cheap Domains, Cheap Blog Hosting
    www.trillhosting.com | support@trillhosting.com
    Hosting Plans | Write To Us | Support | Client Area | About Us

    CodeCall Blog | CodeCall Wiki

  10. #20
    Programmer techker is an unknown quantity at this point
    Join Date
    Aug 2008
    Location
    mtl
    Posts
    136

    Re: Tutorial: Storing Images in MySQL with PHP / Part II / Display your images

    nothing at all...

+ Reply to Thread
Page 2 of 16
FirstFirst 1 2 3 4 12 ... LastLast

Thread Information

Users Browsing this Thread

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

     

Similar Threads

  1. Tutorial: Storing Images in MySQL with PHP
    By Jordan in forum PHP Tutorials
    Replies: 43
    Last Post: 01-16-2010, 10:35 AM
  2. Tutorial: PHP to MySQL
    By Jordan in forum PHP Tutorials
    Replies: 20
    Last Post: 08-28-2009, 04:22 AM

Bookmarks

Bookmarks

     
        Algorithms and Data Structures

        Java tutorials

        Algorithms Forum

Posting Permissions

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