Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Image presentation via Perl script

Reply
Thread Tools

Image presentation via Perl script

 
 
Ed Jay
Guest
Posts: n/a
 
      10-31-2005
I'm using a Perl script to generate html pages. I want to use images in
the html page. The fundamental code I use to display an image is:

print "<p><img src=\"http://www.my-site.com/image.gif\" border=1
width=\"53\" height=\"32\" alt=\"logo\">\n";

The image doesn't display.

I have the same problem importing linked external style sheets and
external javascripts.

--
Ed Jay (remove M to respond by email)
 
Reply With Quote
 
 
 
 
Jonathan N. Little
Guest
Posts: n/a
 
      10-31-2005
Ed Jay wrote:

> I'm using a Perl script to generate html pages. I want to use images in
> the html page. The fundamental code I use to display an image is:
>
> print "<p><img src=\"http://www.my-site.com/image.gif\" border=1
> width=\"53\" height=\"32\" alt=\"logo\">\n";
>
> The image doesn't display.
>
> I have the same problem importing linked external style sheets and
> external javascripts.
>

Best use CGI.pm Then your code would be... I formatted it so your can
see the parts without the NG wordwrap confusing things

use "CGI";

print p(
img(
{
-href=>'http://www.my-site.com/image.gif',
-border=>1,
-width=>53,
-height=>32,
-alt=>'logo'
}
)
);

if your want it all 'prettified' with CR's and TAB's then

use CGI:retty;

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
 
 
 
mbstevens
Guest
Posts: n/a
 
      11-01-2005
Ed Jay wrote:
> I'm using a Perl script to generate html pages. I want to use images in
> the html page. The fundamental code I use to display an image is:
>
> print "<p><img src=\"http://www.my-site.com/image.gif\" border=1
> width=\"53\" height=\"32\" alt=\"logo\">\n";
>
> The image doesn't display.
>
> I have the same problem importing linked external style sheets and
> external javascripts.
>

http://www.mbstevens.com/howtothumb/
....toward the bottom of the article is a Perl script to display an
image, with a lot of explanation. I suggest you read the whole article
to understand why some of the things were done.

You should be able to use external stylesheets and javascripts. You're
addressing them wrong, most probably. Remember that the address is
relative to the place the script executes, not the base address of your
website.


 
Reply With Quote
 
Ed Jay
Guest
Posts: n/a
 
      11-01-2005
mbstevens <> wrote:

>Ed Jay wrote:
>> I'm using a Perl script to generate html pages. I want to use images in
>> the html page. The fundamental code I use to display an image is:
>>
>> print "<p><img src=\"http://www.my-site.com/image.gif\" border=1
>> width=\"53\" height=\"32\" alt=\"logo\">\n";
>>
>> The image doesn't display.
>>
>> I have the same problem importing linked external style sheets and
>> external javascripts.
>>

>http://www.mbstevens.com/howtothumb/
>...toward the bottom of the article is a Perl script to display an
>image, with a lot of explanation. I suggest you read the whole article
>to understand why some of the things were done.
>
>You should be able to use external stylesheets and javascripts. You're
>addressing them wrong, most probably. Remember that the address is
>relative to the place the script executes, not the base address of your
>website.
>

I understand that. That's why I tried, unsuccessfully, to use an absolute
address.

--
Ed Jay (remove M to respond by email)
 
Reply With Quote
 
Ed Jay
Guest
Posts: n/a
 
      11-01-2005
"Jonathan N. Little" <> wrote:

>Ed Jay wrote:
>
>> I'm using a Perl script to generate html pages. I want to use images in
>> the html page. The fundamental code I use to display an image is:
>>
>> print "<p><img src=\"http://www.my-site.com/image.gif\" border=1
>> width=\"53\" height=\"32\" alt=\"logo\">\n";
>>
>> The image doesn't display.
>>
>> I have the same problem importing linked external style sheets and
>> external javascripts.
>>

>Best use CGI.pm Then your code would be... I formatted it so your can
>see the parts without the NG wordwrap confusing things
>
>use "CGI";
>
>print p(
> img(
> {
> -href=>'http://www.my-site.com/image.gif',
> -border=>1,
> -width=>53,
> -height=>32,
> -alt=>'logo'
> }
> )
>);
>
>if your want it all 'prettified' with CR's and TAB's then
>
>use CGI:retty;


Thanks. You introduced me to the world of Perl modules. I had no idea...

--
Ed Jay (remove M to respond by email)
 
Reply With Quote
 
Toby Inkster
Guest
Posts: n/a
 
      11-01-2005
Ed Jay wrote:

> print "<p><img src=\"http://www.my-site.com/image.gif\" border=1
> width=\"53\" height=\"32\" alt=\"logo\">\n";
>
> The image doesn't display.


URL?

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

 
Reply With Quote
 
mbstevens
Guest
Posts: n/a
 
      11-01-2005
Toby Inkster wrote:
> Ed Jay wrote:
>
>
>>print "<p><img src=\"http://www.my-site.com/image.gif\" border=1
>>width=\"53\" height=\"32\" alt=\"logo\">\n";
>>
>>The image doesn't display.

>
>
> URL?
>

To sys op:
Yes, post the actual site and image locations. And, assuming the whole
script is in a place we don't have read access, post it too (possibly
minus your de-tainting code, if you don't want to make that public.)
 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      11-01-2005
Ed Jay wrote:

> "Jonathan N. Little" <> wrote:
>
>
>>Ed Jay wrote:
>>
>>
>>>I'm using a Perl script to generate html pages. I want to use images in
>>>the html page. The fundamental code I use to display an image is:
>>>
>>>print "<p><img src=\"http://www.my-site.com/image.gif\" border=1
>>>width=\"53\" height=\"32\" alt=\"logo\">\n";
>>>
>>>The image doesn't display.
>>>
>>>I have the same problem importing linked external style sheets and
>>>external javascripts.
>>>

>>
>>Best use CGI.pm Then your code would be... I formatted it so your can
>>see the parts without the NG wordwrap confusing things
>>
>>use "CGI";
>>
>>print p(
>> img(
>> {
>> -href=>'http://www.my-site.com/image.gif',
>> -border=>1,
>> -width=>53,
>> -height=>32,
>> -alt=>'logo'
>> }
>> )
>>);
>>
>>if your want it all 'prettified' with CR's and TAB's then
>>
>>use CGI:retty;

>
>
> Thanks. You introduced me to the world of Perl modules. I had no idea...
>

Beats the crap out of all that quote escaping and with the CGI.pm your
are less like to make an HTML (actually XHTML 1.0 Transitional) syntax
error. Can also save you a lot of coding...

my @list=qw(one two three four five six);
print ul(li(\@list));

Just imagine:

print p(\@paragraphs);

Also another tip, lookup functions q(), qq() and qw() that can be your
friends

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CGI: Execute a perl script inside another perl script xdarcos@hotmail.com Perl Misc 20 01-18-2005 12:33 PM
Execute another perl script from my perl script Petterson Mikael Perl Misc 3 01-05-2005 01:31 PM
problem calling perl script from SOAP server perl script pj Perl Misc 3 04-09-2004 10:23 PM
Perl Help - Windows Perl script accessing a Unix perl Script dpackwood Perl 3 09-30-2003 02:56 AM
How to make Perl Script "POST" call from another Perl Script??? Wet Basement Perl 1 07-15-2003 10:25 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57