View Single Post
Old 06-03-2008, 01:21 PM   #1 (permalink)
j4v1
The Contributor
 
j4v1's Avatar
 
Join Date: May 2008
Posts: 30
Thanks: 5
j4v1 is on a distinguished road
Default Calling an image

A few quick questions that would truly help me complete a project i'm working on.

I have the following script that generates an image. The script works great, but heres where I'm stuck:

I need to call the image it generates from an HTML file. So, in that file I'm unsure on how to tell the script to execute and then go out and grab the generated image.


PHP Code:
<?php
resize
("./""http://images.wsdot.wa.gov/nwflow/flowmaps/sysvert.gif""538""./");
function 
resize($cur_dir$cur_file$newwidth$output_dir)
{
    
$dir_name $cur_dir;
    
$olddir getcwd();
    
$dir opendir($dir_name);
    
$filename $cur_file;
    
$format='image/gif';
    if(
preg_match("/.jpg/i""$filename"))
    {
        
$format 'image/jpeg';
    }
    if (
preg_match("/.gif/i""$filename"))
    {
        
$format 'image/gif';
    }
    if(
preg_match("/.png/i""$filename"))
    {
j4v1 is offline  
Reply With Quote