Help - Search - Member List - Calendar
Full Version: cgi link
WorkTheWeb Forums > Webmaster Resources > Perl Beginner Help
Support our Sponsors!
Brent Clark
Hi all

keep getting this message below.

Undefined subroutine &main::Link called at C:/Program Files/Apache
Group/Apache2/cgi-bin/ecco/scripts/common/getXmlAgents.pl line 24.

Here is my code

print $html->header(),

$html->start_html('Get REMOTE BOOKINGS',
-head=>Link({-rel=>'STYLESHEET', -href=>'/styles/ecco1.css'}),
-bgcolor=>'white' ),

$html->start_form(-method => "POST", -action => "" ),

Im trying to get a line as such:
<LINK REL=STYLESHEET HREF="/styles/ecco1.css" TYPE="text/css">

Chris Devers
On Wed, 22 Jun 2005, Brent Clark wrote:

QUOTE
[I'm] trying to get a line as such:
<LINK REL=STYLESHEET HREF="/styles/ecco1.css" TYPE="text/css"

You're already using CGI.pm, so why not let it do this for you?

<http://search.cpan.org/dist/CGI.pm/CGI.pm#LIMITED_SUPPORT_FOR_CASCADING_STYLE_SHEETS>

Modifying the code there a bit, this could work:

$newStyle = qq[
<!--
P.Tip {
margin-right: 50pt;
margin-left: 50pt;
color: red;
}
P.Alert {
font-size: 30pt;
font-family: sans-serif;
color: red;
}
-->
];

print $cgi->header(),
$cgi->start_html( -title=>'CGI with Style',
-style=>{-src => '/style/st1.css',
-code => $newStyle}
);

Or, to more directly do what you're trying to do, simply adapt the
section right after the above block:

Any additional arguments passed in the -style value will be
incorporated into the <link> tag. For example:

start_html(-style=>{-src=>['/styles/print.css',
'/styles/layout.css'],
-media => 'all'});

This will give:

<link rel="stylesheet" type="text/css" href="/styles/print.css" media="all"/>
<link rel="stylesheet" type="text/css" href="/styles/layout.css" media="all"/>

Or if you really want something more customized -- the example you give
isn't doing anything exotic, so probably not -- then yes you can use the
$cgi->Link method, but really the CSS-specific stuff is what you need.



--
Chris Devers

Graeme St.Clair
Try something like:-

$html .= start_html( -title => "Rhubarb",
-style => { 'src' => '../rhubarb.css' },
-script => [ { 'src' => '../rhubarb.js' },
$jscript ]
);

HTH, GStC.

----- Original Message -----
From: "Brent Clark" <[Email Removed]>
To: "Beginners Perl" <[Email Removed]>
Sent: Wednesday, June 22, 2005 10:00 AM
Subject: cgi link


QUOTE
Hi all

keep getting this message below.

Undefined subroutine &main::Link called at C:/Program Files/Apache
Group/Apache2/cgi-bin/ecco/scripts/common/getXmlAgents.pl line 24.

Here is my code

print $html->header(),

$html->start_html('Get REMOTE BOOKINGS',
-head=>Link({-rel=>'STYLESHEET', -href=>'/styles/ecco1.css'}),
-bgcolor=>'white' ),

$html->start_form(-method => "POST", -action => ""  ),

Im trying to get a line as such:
<LINK REL=STYLESHEET HREF="/styles/ecco1.css" TYPE="text/css"

--
To unsubscribe, e-mail: [Email Removed]
For additional commands, e-mail: [Email Removed]
<http://learn.perl.org/> <http://learn.perl.org/first-response




Brent Clark
Graeme St.Clair wrote:
QUOTE
Try something like:-

$html .= start_html( -title      => "Rhubarb",
-style      => { 'src' => '../rhubarb.css' },
-script    => [ { 'src' => '../rhubarb.js' },
$jscript ]
);

HTH, GStC.


ahh worked like a charm

thanks

Brent


PHP Help | Linux Help | Web Hosting | Reseller Hosting | SSL Hosting
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2005 Invision Power Services, Inc.