in reply to Re: CGI SCRIPT ITSELF IS DISPLAYED
in thread CGI SCRIPT ITSELF IS DISPLAYED

Thanks for the suggestion..!! I managed to run the cgi script on my server by configuring the file (1./etc/apache2/sites-enabled/000-default.conf 2./etc/apache2/apache2.conf) . However, still am not able to generate a figure. Instead, a blank layout is shown.I know that it is something related to file pointing the figure.Kindly suggest me. anikng

Some information, My html file is in var/www/html folder. CGI script is under usr/lib/cgi-bin (i use this path to the configuration file for cgi configuration).

<!DOCTYPE html> <html> <body> <h3> <center>TRANSCRIPTION FACTOR FAMILY</center></h3> <form action="http://localhost/cgi-bin/test.cgi" method="GET"> <input type="submit" value="NAC"> </form> </body> </html>
#!/usr/bin/perl use CGI; use CGI::Carp qw(fatalsToBrowser warningsToBrowser); $q=new CGI; print "Content-type: text/html\n\n"; @field=$q->param(); $name=$q->param("value"); print<<"OUTPUT"; <html> <head> <title>TRANSCRIPTION FACTOR DATABASE </title> </head> <body> <img src="file:///var/www/html/index.jpeg" height="42 +0" width="420"> <br><br><br><br><br> <center><table border=0> <tr><td> </td></tr> </table></center> </body> </html> OUTPUT

Replies are listed 'Best First'.
Re^3: CGI SCRIPT ITSELF IS DISPLAYED
by Corion (Patriarch) on Sep 26, 2014 at 07:59 UTC
    <img src="file:///var/www/html/index.jpeg" height="420" width="420">

    That's not how HTTP works with HTML. Every resource generates its own HTTP request. You will need to serve the image via HTTP too, instead of using the file:// protocol.

    You will need to use a file path that is relative to your CGI script. Maybe

    <img src="index.jpeg" height="420" width="420">

    already is enough, because the image lives in the same folder as your HTML page.

    This has very little to do with Perl. I recommend you try it out with a static HTML page and a static image file first.

Re^3: CGI SCRIPT ITSELF IS DISPLAYED
by Anonymous Monk on Sep 26, 2014 at 08:06 UTC

    However, still am not able to generate a figure. Instead, a blank layout is shown.I know that it is something related to file pointing the figure.Kindly suggest me. anikng

    Go back and read more about urls, file:... is not http://localhost