Dear Monks,

These problema are not pertaining to Perl but CGI. I am using a Fedora Core3 OS and Apache as webserver. Now after taking input from user, my script generates two things

(A) Some texts (B) A graph (using GD) in jpg format.

For (A) I am saving in /tmp and able to send directly to user from there.

Prob is with (B).. 1 If I save it in /tmp then my server is not able to find it even I give the path print "<img src=\"/tmp/upload/$tag.jpg\">"; or even if I use print "<img src=\"http://127.0.0.1/../../../tmp/upload/$tag.jpg\">"; It is not able to locate and send the jpg img. 2 Now it is sending from src=\"http://127.0.0.1/image/$tag.jpg\">"; means if jpg is in /var/www/html/image it is happily working but then the problem is my CGI is not able to write the graph in /var/www/html/image location.

One more doubt is about HTML headers in the scripts. So far I am only providing

print "Content-type:text/html\n\n";

Please help me sorting out these issues. Thank you for reading this much..


In reply to CGI-Perl:: Location for saving the GD output by cool

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.