ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  incorporating cgi image in img tag with parameter
Posted by arun on Apr-01-2013 20:58
i want to display image on browser with the cgi script that (uses chart director) takes parameters from user through form
how to do that using img tag
the following code is that i have tried to execute
<HTML>
<BODY>

<h1>Hello World!</h1>
<p>Hi, this is my first web page with ChartDirector charts.</p>

<IMG SRC="/aaa.bbb.ccc.ddd/cgi-bin/perldemo_cgi/simplebar.cgi $date ">
if i dont provide any $date in img tag then it produces output like this

<IMG SRC="/aaa.bbb.ccc.ddd/cgi-bin/perldemo_cgi/xyz.cgi  ">
but not with parameters
is there a way to do so?????????

  Re: incorporating cgi image in img tag with parameter
Posted by Peter Kwan on Apr-01-2013 23:49
Hi arun,

In HTML, you may pass parameters as query parameters in URL. For example:

aaa.bbb.ccc.ddd/cgi-bin/perldemo_cgi/xyz.cgi?id=qwerty&fruit=apple

So for your case, after your user input to the form and press the submit button, the Perl script that handles the form can generate the HTML with the <IMG> tag, in which the URL is like the above, with the query parameters set as the values entered by your user (of course with proper escaping to avoid characters that are invalid in HTML or URL).

Hope this can help.

Regards
Peter Kwan