CGI

    Date: 04/20/05 (PHP Community)    Keywords: php, mysql, browser, html, database, sql

    Hi all,
    I have a program that gets its images from a mysql database. I pass a string to the program that gets the picture inside an HTML image tag like this:

    <*img src=\"show_image.php/thumbnails/$boxData[thum_id]/img.jpg\">

    This is what the string looks like when it has been passed:

    show_image.php/thumbnails/7678/img.jpg

    This is the program show_image.php

    $pic_id = get_pic_id($_SERVER['REQUEST_URI']);
    
    $table_name = get_table_name($_SERVER['REQUEST_URI']);
    
    $file_data = get_file_data($pic_id, $table_name);
    
    header("Content-type: " . $file_data['type']);
    
    echo $file_data['binary_data'];
    


    The functions get_pic_id() and get_table_name() run a regex on the string and return the correct portions of the string that I then pass to get_file_data() and get the binary data.

    I used to get the pic_id and the table_name from the $_GET string, but I wanted to force the browser to cache the images so a friend suggested using this. Thing is he wrote his version in Python which I dont know.

    My question to you all is do you know if this possible and if so where can I get the string from?

    Source: http://www.livejournal.com/community/php/288307.html

« Strip a period at the end... || going nuts »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home