in cgi program if i want to display pdf files from some other directory ex /view/dvsview/vobs/ps/projects/xx.pdf which is not ubder htdocs directory how to display that file in web it always looks for htdocs directory when i am running that program can u please help me my program looks like this can u please send a mail to jyothil@yahoo.com
#!/usr/local/bin/perl print "Content-type:text/html\n\n"; print "<html>"; print "<head>"; print "<title>xx </title>"; print "<body bgcolor=lightblue>"; print qq[ <SCRIPT LANGUAGE= javascript> function back() { history.go(-1); } </SCRIPT>]; $ct=$ENV{"CONTENT_TYPE"}; $cl=$ENV{"CONTENT_LENGTH"}; $xy="/view/dvsview/vobs/ps/projects/linkair/docs/internal/servdefns/ip +relaysd"; #$xy1="/www/apache-1.3.19/cgi-bin/ps"; $op=opendir(DIR,$xy); #print "reurn opendir = $op"; @files=readdir(DIR); print qq[<p><a href="../../t1/lr_sd.pdf">files</a></p> ]; foreach $files(@files) { if($files =~/pdf$/) {$pq=$xy.'/'.$files; print qq [ <center> <table border="1" width=10%> <tr><td> <p><a href="$pq">$files</a></p> </td></tr> </table> </center> ]; } } closedir(DIR); &successsubmit("Doc successfully displayed!!","navy"); sub successsubmit { my($printstr,$color) = @_; print "<form><center>"; print "<br><br><br><br>"; print "<font color=$color font size=6>"; print "<b>$printstr</b>"; print "</font>"; print "<br><br><br>"; print "<font size=3>"; print "<input type=\"button\" value=\"BACK\" onClick=\"back()\">"; print "</font></center>"; print "</form>"; }

Edit kudra, 2001-10-05 Added code tags


In reply to pdf file display by jyothi

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.