CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced:
HOW TO SEE PNG image in browser

 



ankit
Novice

Apr 13, 2010, 2:27 AM

Post #1 of 22 (6952 views)
HOW TO SEE PNG image in browser Can't Post

hi ,
when i run CGI script it gets output of PNG image like given below,and i am also used GD module. Help me

‰PNG

���
IHDR��r��œ���ˆìÙõ��� PLTEÿÿÿ���ÿ��Àɝ°�� vIDATxœí]Mn㼤 p“µt‡`N!/¼—�ñ>A–9E0« §|dÿMIvÞĦ¾™ jA?¬áP2ÀBwW;�������ÀCÑ-~ÎáœcèøàC9K÷†%Lz¯‹g›vßcvïû~šz:Ìç Æ©œ¥{Ýè;½w‰g›vßËì.]pñIøà¦x˜ùÌÅ{‰}̏Dv×Ó8s1ÒÒ¸žyköÐÇEíýÐ/Sw¹ ½›çôÔæt¶Ì“°óY¼(ì!%Z> ±Çƒ#²íºÓÚ¦I»zÝ]µîyî=ÿ÷ò¡ÌÝ®{Ó·ê—x¡ ~‰ŸÔ9}RSpSº˜Î–!Þ[ÒÂÊYüܺqû4n Ï”}‡§¹Ç{‰ìˆ_��Å'ýyoÃrz}‰Ÿî$¿Ærz}ýxz¿Ÿ}Ÿåôúöôü|?û>ËéóÍýú¸›ý
KüWÝóÖ}Ÿ¥ñÊÐû¸÷‹| ��ÿ|¨EÑ55dTT>+ãò#Ã"¡Ÿêíóµ}³Ùoç³2.?wß|°ìº½'¡7û$[¢ Ã8ã²vW䄨>ÇÕÐ@úg`Á’|
qhTC!²“`˜¥Uz_¾ 0&ÁÔ‘¦"U³§9ôŸ“(:Ç¡,˜è«K¢(I+™û™Œ$˜XS¥Ï4³������À7°+‘¬R2÷D‰`"½U?iD³ï†$ìžÚÜ“í³l­ig^?9–íº°;#b4ä¦cQ¹Ãì|ѳð2ÀD’²L:„¢H¤¢ð)ÐDq£t1h*^ ÌNI0‘ÞRME
k4"l»îºŒU¼©«Ö½»²îoÊ"숷J¦™ôOü¤F4QÜ(Ñ Ô"C£ŠJI0‘ÞRMµÐ“F„ó{������~&º½ðÑú@‚)I¤Z)ÅMý6útM7]PÐÖ:m¦ë=µw;qŠZ7õâKDÈæÕq¬„ELÖ2$…¼³x¾:ÂÒí =¬)…ô"iªEJɉRš8ÐÄì*­í ,ÕÜy*ºîU¬Ì®»Óuïòº»rF4aqǼUú¤Ò—%¹x…ô"i*Š"E‰4©R:“ЊìÝ’¥U¼—Æ1ËÔþ·������ü\lµ‘œÕ*êf*—@Õ™ÝovÑrVï·o&}q±L}QØM]‘”áp:™lö'ÝóoäN¾§ìÕ€CØ¥jiH·)ß.p
SÒ?ïQ„IcJ%@åä^*
$­Ì€íº›ðÑÞºKbÊ÷ź7}«T-%m4.¢|»¨.\ÃD&§1¥ šäž°Ë™Žø5������?Y0­…ÏNEÓµGö*¡˜ÝëÖz½EÞ©}¹öÈ^ÍŒaç<²©(�‰•˜š£j‘ò"ëÕ 5=N³ØVʦ-{`'á
äïàÝ ÚHØ©èIŠ—Dh
"‘螸̉ãTF7•uõ"+M6ìdî­+¡f©âZ¯{Ó·JÁ$JÂ;ªS"›ÑFcŠ)MTô$ÅK"´¨ *UB‘Ð"½•BRq8t������pv‚IµY^&™Ú§[ѧMžÞ*ìP۪尃©’¹§XçéõÞÆyú•ÿ»ÆeÙ"IiYàHúZΑ¤cØÉßAÌòH7±»žc‰ä³6Ùc—ç5‡ì!‚Š©äSb¶¾ioÝsª¡{Ÿç®feîZæ´³2Mߪ˜åͤ›Ø]ob‰4Mì§7±É»DL}R{ˆIÄT2’ ²2w�������øêx“1ß•HZÑT=RÆ]ʳב c9½»™ÖÚ—ê‘2Ε3a×:ÍF3¾áRsäsäÄ){µŒÙê!Å_Œø9ŠœÇ)ÞD¾ľpEÓÂéz.pô)±õwd!~zäXÎìtÑÌ}6sÍW¯»¤äÙ¹{{½î2÷ÝxÓ£ßjÇxŽãMì ÑKL)qºÞ4qôIØÅVˆÄOË]Š71Ë¿&������ৢ[%á•\¼M¾p¸Vßd³¶n´ÿùÂk`]ߤî 6[NDBŽ9MNv¬Å5ÏÂ.&qÌ>ˆ|Êæäó,v䣨¬×Þ胘E$–PùBhE“É#ôF>•ˆ© È­‘Ÿéº»#Þª–+±|¢¬½QìÈû®˜“,‘Ô€\jŸF5’ nNgv`…Õþ·�Àߎ§÷–ìÏÏ`ßǯ–ìÿòÊ´e�àÑø^)“q‚¨ý$6ñ¦ï½Ï€Úy`oª“æzÛ)ÉvŸ•àŠmW›ŸÌå;¹É«;ŽõOJÐÔ%Â؉ÉøãM¤†ô";HLA>‰­„›ä@EOéÞ¿&��þ+|ÒŸ÷6ä§××Nh^_
­Óë[C9qú|k(´âÜ
­Æ+CoB �~Hø°DªÛ1ÕòiÓâÖT;m²ö¬?A*àï½_7î©7Ú›f¨¦.f“ßE2„ÙSX„ Š|Õ0Is̸©jB«RHøZÏ>èË
bú°b'ë<ñŒð4Nl%(Þär‡ÜšÝ+{{îb—Ù})êŠ­^foúV)`ÄåJ>·c=™{ǽÜ$MXh-<€7Q*J«%wÈmüC�à`¥DÙwOŸ$7J‰3©ÞËž•Òóó¯—ÏG³g=ðüüþûõå±ìE)ýúx?}>˜½(¥8÷ÓË?µ2E)Ñ[}ì �À_¯ê”þçñ?ˆ7}‘ѵWs;Þd>W©%\WªŒÌEqnu Q•ÝxSvã<žTæ”dšŒÏ¦†É\¤½ä(ÐÄg—Ëîܳz5÷¬”rØií<žíÈõÌmꛚ¼UŠ)‰óø¤Š"‘ R“ñÁÔ0•‹œ G|h¢3JìC}������pÖÙw¶á­øéY“½½·_×7å<-ÛUœ×¬Û^3Ô[õMZxÃzÀsKÚâÕ á‰¸hé‘äÕ©Î1’¦®@jËHq¢]H=š˜],ÇS0IÌò¨öi¢Â&ö~XŠ´b[=Éö[Ï]íÌÜEÐÝ^w3Ù~ö–oUí„ݱ­8ûâÅ31ËãÚ'.lšÏšÑÇÒJlõ$Û/E¦Úÿ–��øñëÅ54&xN/ÍØ?OíØ¿¾=5cÿüýòôÙpî/O
×½éÊÐ[mk•�@#ÔÂg›‹÷ÝX³ûj‹¼ÍÚúnÔ"³giR²åü¶,©dË•
$Ñ2j­¬k\KöЗŽµÒ£id1u‘z©RûĹxÚþÖ=„*$•n½îÂÞëÜg­Æ*µOyîóÞÜçü^ûé5{«j$.Š‡«–¸°I>°\ûĹxÚþvšäÀ›4$•†C7������÷પ«VgÓÊŽ|«·˜Ý_Û7×u1«³Îvw晽80ƒ8)ÑÉÞà¶:I[ÙzÕ@’†f4Ð1ì!û;(¢ì»d—øÄO/9kíÓE{Û:éí¤ézâµÇzËö½]ÍýÚºgk ™ûõuw_ˆFoµø;œÏ’}—¬óˆœ „]jŸ¤·m:#;rMׯ=6àCß[������àÁD2Èʧ'ˆê+¦Ö²‹ÙM‚–ïVíÏ€ê»í^oÐ…½x| &L4›š#6iPñ"Ät{'"Ô–],ÇIeù4ûNÞ.RµäÕy¼ˆ)‰Luc؍7ñŠ‰²s7ÅK}Ò¹×bj.íŸ6ñ¦–oµcËñ3Ë ‘OÔéVÊ•8%Oª–H0‰G¹ˆ)‰L%ï
Ä›������€Ç`Çr¼ªaªÍòâÙ±çú–²™®ª]j[µTó‡ìkSp[eTšÐŠ:ø«Øƒ´cʾ™Ú1I‹[j›Ø÷æî‹/D™{½îß[™¦oUÚ1_ˆx¶pô)”·3•2ý);����ü!þɧAä,Y<=����IEND®B`‚


FishMonger
Veteran / Moderator

Apr 13, 2010, 5:00 AM

Post #2 of 22 (6950 views)
Re: [ankit] HOW TO SEE PNG image in browser [In reply to] Can't Post

You need to specify the correct Content-type.
http://en.wikipedia.org/wiki/Internet_media_type


roolic
User

Apr 13, 2010, 9:53 PM

Post #3 of 22 (6946 views)
Re: [ankit] HOW TO SEE PNG image in browser [In reply to] Can't Post

try something like

Code
open (IMG,"< someimage.png") || die; 
binmode IMG;
my $image = join('',<IMG>);
close IMG;

print "Content-type: image/png\n\n";
print $image;



ankit
Novice

Apr 14, 2010, 9:25 PM

Post #4 of 22 (6890 views)
Re: [roolic] HOW TO SEE PNG image in browser [In reply to] Can't Post

Thanks for your reply.
and plz tell me where i can use your given code in my script.
This is my script ,,
plz help me.

#!c:/wamp/apps/Perl/bin/perl.exe


# webrebase1 - a web interface to the Rebase modules

# To install in web, make a directory to hold your Perl modules in web space

use Restrictionmap;
use Rebase;
use SeqFileIO;
use CGI qw/:standard/;

use strict;
use warnings;

print header,

start_html('Restriction Maps'),
i('<font size=6><font color=yellow>Draw Restriction Maps</font>'),
hr,
start_multipart_form,
'<body>',
'<body bgcolor="green">',
'<font color=white>',
h3(" Restriction enzyme(s)? [case sencetive] "),
textfield('enzyme'), p,
h3(" Sequence filename (fasta or raw format): "),
filefield(-name=>'fileseq',
-default=>'starting value',
-size=>50,
-maxlength=>200,

), p,
strong(em("or")),
h3("Type sequence: "),
textarea(
-name=>'typedseq',
-rows=>10,
-columns=>60,
-maxlength=>1000,
), p,
h3(" Make restriction map:"),
submit, p,
'</font>',
'</body>',
hr,
end_form;


if (param( )) {

my $sequence = '';

# must have exactly one of the two sequence input methods specified

if(param('typedseq') and param('fileseq')) {
print "<font color=red>You have given a file AND typed in sequence: do only one!</font>", hr;
exit;
}elsif(not param('typedseq') and not param('fileseq')) {
print "<font color=red>You must give a sequence file OR type in sequence!</
font>", hr;
exit;
}elsif(param('typedseq')) {
$sequence = param('typedseq');
}elsif(param('fileseq')) {
my $fh = upload('fileseq');
while (<$fh>) {
/^\s*>/ and next; # handles fasta file headers
$sequence .= $_;
}
}



# strip out non-sequence characters

$sequence =~ s/\s//g;
$sequence = uc $sequence;

my $rebase = Rebase->new(
#omit "bionetfile" attribute to avoid recalculating the DBM file
dbmfile => 'BIONET',
mode => '0444',
);

my $restrict = Restrictionmap->new(
enzyme => param('enzyme'),
rebase => $rebase,
sequence => $sequence,
graphictype => 'text',

);


print "Your requested enzyme(s): ",em(param('enzyme')),p,
"<code><pre>\n";
(my $paramenzyme = param('enzyme')) =~ s/,/ /g;
foreach my $enzyme (split(" ", $paramenzyme)) {
print "Locations for $enzyme: ",
join( ' ', $restrict->get_enzyme_map($enzyme)), "\n";


my @count=' ';
@count = join ' ', $restrict->get_enzyme_map($enzyme)+1, "\n";
print "Total Fragments of the sequence are: @count \n";


print "\n\n\n";

print $restrict->get_graphic,


"</pre></code>\n",
hr;
open (IMG,"< someimage.png") || die;
binmode IMG;
my $image = join('',<IMG>);
close IMG;

print "Content-type: image/png\n\n";
print $image;
}
}
#############


roolic
User

Apr 14, 2010, 11:14 PM

Post #5 of 22 (6879 views)
Re: [ankit] HOW TO SEE PNG image in browser [In reply to] Can't Post

you should not mix text and binary data (image) within single server response. because the browser is not able to process such data. The most simple way to show the image within the html is just printing the refernece to an image. The browser will fetch and place it by itself (with separate request as it always does).

for example if you store your image into some local_path/images/ folder which is visible from web as http://your_host/web_path/images/ and the image name is some_image.png

the code will be following:


Code
print header; # this prints content-type: text/html 

....

print "Total Fragments of the sequence are: @count \n";
print "</pre></code>\n", hr;

my $img_filename = 'some_image.png';
print "<img src=\"/web_path/images/$img_filename\"><br />";



(This post was edited by roolic on Apr 14, 2010, 11:15 PM)


ankit
Novice

Apr 14, 2010, 11:23 PM

Post #6 of 22 (6875 views)
Re: [roolic] HOW TO SEE PNG image in browser [In reply to] Can't Post

currently i am excute following script & it gives me output in text/html,but when i am change the "graphictype" to "png" it will gives pevious output ,and i am not seeing png image iam also sent its supporing module restrictionmap.pm in which the subroutine is saved ,,do it is easy to understand the problem for you.


#!c:/wamp/apps/Perl/bin/perl.exe


# webrebase1 - a web interface to the Rebase modules

# To install in web, make a directory to hold your Perl modules in web space

use Restrictionmap;
use Rebase;
use SeqFileIO;
use CGI qw/:standard/;

use strict;
use warnings;

print header,

start_html('Restriction Maps'),
i('<font size=6><font color=yellow>Draw Restriction Maps</font>'),
hr,
start_multipart_form,
'<body>',
'<body bgcolor="green">',
'<font color=white>',
h3(" Restriction enzyme(s)? [case sencetive] "),
textfield('enzyme'), p,
h3(" Sequence filename (fasta or raw format): "),
filefield(-name=>'fileseq',
-default=>'starting value',
-size=>50,
-maxlength=>200,

), p,
strong(em("or")),
h3("Type sequence: "),
textarea(
-name=>'typedseq',
-rows=>10,
-columns=>60,
-maxlength=>1000,
), p,
h3(" Make restriction map:"),
submit, p,
'</font>',
'</body>',
hr,
end_form;


if (param( )) {

my $sequence = '';

# must have exactly one of the two sequence input methods specified

if(param('typedseq') and param('fileseq')) {
print "<font color=red>You have given a file AND typed in sequence: do only one!</font>", hr;
exit;
}elsif(not param('typedseq') and not param('fileseq')) {
print "<font color=red>You must give a sequence file OR type in sequence!</
font>", hr;
exit;
}elsif(param('typedseq')) {
$sequence = param('typedseq');
}elsif(param('fileseq')) {
my $fh = upload('fileseq');
while (<$fh>) {
/^\s*>/ and next; # handles fasta file headers
$sequence .= $_;
}
}



# strip out non-sequence characters

$sequence =~ s/\s//g;
$sequence = uc $sequence;

my $rebase = Rebase->new(
#omit "bionetfile" attribute to avoid recalculating the DBM file
dbmfile => 'BIONET',
mode => '0444',
);

my $restrict = Restrictionmap->new(
enzyme => param('enzyme'),
rebase => $rebase,
sequence => $sequence,
graphictype => 'text',

);


print "Your requested enzyme(s): ",em(param('enzyme')),p,
"<code><pre>\n";
(my $paramenzyme = param('enzyme')) =~ s/,/ /g;
foreach my $enzyme (split(" ", $paramenzyme)) {
print "Locations for $enzyme: ",
join( ' ', $restrict->get_enzyme_map($enzyme)), "\n";


my @count=' ';
@count = join ' ', $restrict->get_enzyme_map($enzyme)+1, "\n";
print "Total Fragments of the sequence are: @count \n";

}

print "\n\n\n";
print $restrict->get_graphic,
"</pre></code>\n",
hr;
print end_html;


}
#############
Attachments: Restrictionmap.pm (7.56 KB)


ankit
Novice

Apr 14, 2010, 11:31 PM

Post #7 of 22 (6874 views)
Re: [ankit] HOW TO SEE PNG image in browser [In reply to] Can't Post

This is the sub routine to devlop a PNG image so now plz tell me how can i store the image in specific folder/link.

thanks for your all responses.

sub _drawmap_png {
my($self) = @_;

# Get text version of graphic
my @maptext = split( /\n+/, $self->_drawmap_text);

# Now make a PNG graphic from the text version

use GD;

#
# Layout information: fonts, margins, image size
#
# Use built-in GD fixed-width font 'gdMediumBoldFont' (could use TrueType fonts)
#
# Font character size in pixels
my ($fontwidth, $fontheight) = (gdMediumBoldFont->width, gdMediumBoldFont->height);

# Margins top, bottom, right, left, and between lines
my ($tmarg, $bmarg, $rmarg, $lmarg, $linemarg) = (10, 10, 10, 10, 5);

# Image width is length of line times width of a character, plus margins
my ($imagewidth) = (length($maptext[0]) * $fontwidth) + $lmarg + $rmarg;

# Image height is height of font plus margin times number of lines, plus margins
my ($imageheight) =
(($fontheight + $linemarg) * (scalar @maptext)) + $tmarg + $bmarg;

my $image = new GD::Image($imagewidth, $imageheight);

# First one becomes background color
my $white = $image->colorAllocate(255, 255, 255);
my $black = $image->colorAllocate(0, 0, 0);
my $red = $image->colorAllocate(255, 0, 0);

# Origin at upper left hand corner
my ($x, $y) = ($lmarg, $tmarg);

#
# Draw the lines on the image
#
foreach my $line (@maptext) {
chomp $line;
# Draw annotation in red
if($line =~ / /) { #annotation has spaces
$image->string(gdMediumBoldFont, $x, $y, $line, $red);
# Draw sequence in black
}else{ #sequence
$image->string(gdMediumBoldFont, $x, $y, $line, $black);
}
$y += ($fontheight + $linemarg);
}

return $image->png;
}


roolic
User

Apr 15, 2010, 4:46 AM

Post #8 of 22 (6864 views)
Re: [ankit] HOW TO SEE PNG image in browser [In reply to] Can't Post

no need to change the Restrictionmap.pm
just try to save the image into file before sending back the reference


Code
print "Total Fragments of the sequence are: @count \n";   
print "</pre></code>\n", hr;

# lets store the image in the images subfolder
# (relating to the script location)
my $img_path = 'images/';
mkdir $img_path unless -d $img_path;

# lets create the image name using the extension
# taken from the object. the result should be 'images/tmp.png'
$img_path .= 'tmp.' . $restrict->{_graphictype};

# storing the image
my $img_binary = $restrict->get_graphic();
open( IMG, "> $img_path" ) || die "can not write to $img_path: $!";
binmode IMG;
print IMG $img_binary;
close IMG;

print "<img src=\"$img_path\"><br />";


probably you'll need to generate the image names then use already created (cached) images instead of generating new 'tmp.png' image on each request


ankit
Novice

Apr 15, 2010, 10:38 PM

Post #9 of 22 (6830 views)
Re: [roolic] HOW TO SEE PNG image in browser [In reply to] Can't Post

Thanks roolic now its working but it only store image in folder it did not gives output on browser.


Ankit


roolic
User

Apr 16, 2010, 1:59 AM

Post #10 of 22 (6821 views)
Re: [ankit] HOW TO SEE PNG image in browser [In reply to] Can't Post

in the browser check the script output via "View source". if the line like
<img src="images/tmp.png">
exists it means the script is working ok but there is a problem with external path and the browser can not reach the image file


ankit
Novice

Apr 16, 2010, 2:32 AM

Post #11 of 22 (6818 views)
Re: [roolic] HOW TO SEE PNG image in browser [In reply to] Can't Post

I am getting following error in my wamp server error log.

C:/wamp/bin/apache/Apache2.2.11/cgi-bin/images/tmp.jpg is not executable; ensure interpreted scripts have "#!" first line
[Fri Apr 16 14:47:56 2010] [error] [client 127.0.0.1] (9)Bad file descriptor: don't know how to spawn child process: C:/wamp/bin/apache/Apache2.2.11/cgi-bin/images/tmp.jpg

In Reply To


ankit
Novice

Apr 16, 2010, 3:03 AM

Post #12 of 22 (6816 views)
Re: [ankit] HOW TO SEE PNG image in browser [In reply to] Can't Post

plz also tell me how can i give the link to open that image in new window,i am trying but it is not working as a hyperlink.


roolic
User

Apr 16, 2010, 3:51 AM

Post #13 of 22 (6813 views)
Re: [ankit] HOW TO SEE PNG image in browser [In reply to] Can't Post

obviously it's a local Apache configuration issue.

the most simple solution is

1. create some working folder. (f.e. d:\myscript) then move your script and libraries (*.pm) there

2. edit apache configuration file (goto Apache folder then conf/httpd.conf). add in the end of file the following lines


Code
 
AddHandler cgi-script .cgi
AddHandler cgi-script .pl

Alias /myscript "d:/myscript"

<Directory "d:/myscript">
Options Indexes FollowSymLinks ExecCGI
AllowOverride None
Order allow,deny
Allow from all
</Directory>


this will make the script available for browser via http://localhost/myscript/script_name.pl. And there will be no apache limitation for storing executables only.

3. restart the apache to make the configuration changes applied


ankit
Novice

Apr 16, 2010, 3:59 AM

Post #14 of 22 (6810 views)
Re: [roolic] HOW TO SEE PNG image in browser [In reply to] Can't Post

yaa I do that, but now it tells "The requested URL /myscript/webrebase111.cgi was not found on this server."


roolic
User

Apr 16, 2010, 4:43 AM

Post #15 of 22 (6807 views)
Re: [ankit] HOW TO SEE PNG image in browser [In reply to] Can't Post

the apache's

Code
Alias /myscript "d:/myscript"

first argument means the url part, the second one is local path
did you move your script to new folder?


ankit
Novice

Apr 16, 2010, 9:16 PM

Post #16 of 22 (6785 views)
Re: [roolic] HOW TO SEE PNG image in browser [In reply to] Can't Post

yaa,now it is working ,,thank you very much Dear.........WinkWink


ankit
Novice

Apr 16, 2010, 9:47 PM

Post #17 of 22 (6782 views)
Re: [roolic] HOW TO SEE PNG image in browser [In reply to] Can't Post

Hi,Roolic----------

can you plz tell me that How can i give the output in tables becouse when i draw table in HTML it is not working even Hyperlik also not working for example-when i give "print qq|<A HREF="C:\wamp\www\images">Click here to save images</A>|, "\n"; " then the browser tells "Firefox doesn't know how to open this address, because the protocol (c) isn't associated with any program."
So please give me the code for drawing table in which sequence name & restriction enzyme and there cutting site included.
---


roolic
User

Apr 16, 2010, 10:05 PM

Post #18 of 22 (6780 views)
Re: [ankit] HOW TO SEE PNG image in browser [In reply to] Can't Post

pay an attention that the local path always differs from remote (web client) path. the apache handles the redirection. so if you place the link for image download (or to navigate to required folder for seeing the content via apache internal tool) it should be the same (built the same way) as for image display:


Code
# absolute path if host is known and never changes 
print qq|<a href="http://your.host/path/images/">click</a>|;

# path relative to some host root which can be any:
# http://localhost/ or http://somesite.com/
print qq|<a href="/path/images/">click</a>|;

# path relative to script location (remote point of view)
print qq|<a href="images/">click</a>|;



ankit
Novice

Apr 16, 2010, 10:20 PM

Post #19 of 22 (6779 views)
Re: [roolic] HOW TO SEE PNG image in browser [In reply to] Can't Post

ok,,it's working now.....Thanks
and What about for drawing table ,,i want to give output in a table format so it is easy to user for understanding the table.


roolic
User

Apr 16, 2010, 11:03 PM

Post #20 of 22 (6775 views)
Re: [ankit] HOW TO SEE PNG image in browser [In reply to] Can't Post

this question is about html not the perl )) sorry, will not answer
take a look here: http://www.w3schools.com/html/html_tables.asp
good luck ))


ankit
Novice

Apr 16, 2010, 11:31 PM

Post #21 of 22 (6770 views)
Re: [roolic] HOW TO SEE PNG image in browser [In reply to] Can't Post

ok ,,i will see there---------
Thanks a lot friend....Wink


ankit
Novice

Apr 19, 2010, 9:59 PM

Post #22 of 22 (6691 views)
Re: [roolic] HOW TO SEE PNG image in browser [In reply to] Can't Post

Hi roolic,,
I have draw the table but i am not able how to give out put for my result , Can you please tell me how can i do this----

(1)This is the script for Table which is working---

start_table(),
print table({-border=>undef},
caption('Output of the Query'),
Tr({-align=>'CENTER',-valign=>'TOP'},
[
th(['Sequence Name', 'Restriction Enzyme','Restriction Site','Total No. of Fragments']),

td([' ' , param('enzyme'),' ']),
]
)
),


(2) Now i want to give out put of following code--(in btw table)

print "Your requested enzyme(s): ",em(param('enzyme')),p,
"<code><pre>\n";
(my $paramenzyme = param('enzyme')) =~ s/,/ /g;
foreach my $enzyme (split(" ", $paramenzyme)) {
print "Locations for $enzyme: ",
join( ' ', $restrict->get_enzyme_map($enzyme)), "\n";


my @count=' ';
@count = join ' ', $restrict->get_enzyme_map($enzyme)+1, "\n";
print "Total Fragments of the sequence are: @count \n";
hr,

}

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives