title: Zend Framework: PHP script in img src tag causing broken image
body: <p>I'm using the JpGraph library within a <a href="http://framework.zend.com/" rel="nofollow">Zend Framework</a> project of version 1.11. I'm trying to display the graph of some data using an <code>img</code> tag by including a php script in the <code>src</code> field, as so:</p>
  
  <pre><code>echo "&lt;img src='vgraph.php?param1=val1&amp;param2=val2...
  </code></pre>
  
  <p>When I do this, the only thing displayed as an image is the my browser's default broken image. Since typical URLs in Zend are treated as controller-action pairs, the path to the file I am including is also treated as a controller-action pair. To investigate why I wasn't getting my image, I viewed the source of the page in the browser. When I clicked on the link for the above <code>img</code> tag, I was directed to a page containing the error: </p>
  
  <pre><code>Invalid controller specified (vgraph.php)
  </code></pre>
  
  <p>I don't by any means intend to use the script as a controller. It is only supposed to display the image of a graph. I am unsure about how to make sure that Zend only uses the file's output as an image, and not to use its path as a URL.</p>
  
  <p>Here is the file I am using for the image, <code>vgraph.php</code>:</p>
  
  <pre><code>&lt;?php
  
  /* graph the vital data */
  
  require_once( 'path/to/Zend/project/web/library/jpgraph/jpgraph.php' ); 
  require_once( 'path/to/Zend/project/web/library/jpgraph/jpgraph_line.php' );
  
  /* get the needed parameters */
  $id = $_GET['param1'];
  $type = $_GET['param2'];
  $from = $_GET['param3'];
  $to = $_GET['param4'];
  
  $graph = new Graph( $width, $height );
  
  /* create the data and plot */
  $obj = new CcFunc_VitalSigns();
  $vitals = $obj-&gt;getVitalData( $id, $type, $from, $to );
  
  /* configure everything */
  $graph-&gt;setScale( 'intint' );
  $graph-&gt;title-&gt;Set( "Graph of " . $type );
  $graph-&gt;xaxis-&gt;title-&gt;Set( "X-Axis" );
  $graph-&gt;yaxis-&gt;title-&gt;Set( "Numerical Value" );
  
  $lp = new LinePlot( $vitals );
  $lp-&gt;setColor( 'blue' );    
  $lp-&gt;setWeight( 5 );
  
  /* add the plot to the graph */
  $graph-&gt;Add( $lp );
  
  /* display the graph */
  $graph-&gt;Stroke();
  </code></pre>
  
  <p><b>NOTE:</b> I've tried other solutions, such as streaming the graph to a <code>png</code> file and letting the <code>src</code> field be the URL of <i>that</i> file, but I was met with the same problem, even after adding a <code>RewriteRule</code> to apache to prevent redirection of <code>.png</code> files. I've settled upon this method as the most comfortable (potential) solution. </p>
  
  <p><b> EDIT:</b> I didn't say this before, but the code where the <code>img</code> tag is echo'd is <i>not</i> a controller, and is actually located in <code>path/to/Zend/roject/web/application/scripts/views</code>. The script <code>vgraph.php</code> is located in <code>path/to/Zend/project/web/library</code>.</p>