homepage Welcome to WebmasterWorld Guest from 54.204.215.209
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor
Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
Forum Library, Charter, Moderators: coopster & jatar k & phranque

Perl Server Side CGI Scripting Forum

    
html and CGI
how to get an html out put from a CGI script
medranoenrique




msg:3715837
 4:36 pm on Aug 5, 2008 (gmt 0)

can any one help me to figure out how to get an html form from a CGI script and how to test if your CGI script works in a server.

this is a script that im using

#!/usr/bin/perl -wT

use strict;
use CGI;

my $q = new CGI;
my $timestamp = localtime;

print $q->header( "text/html" ),
$q->start_html( -title => "The Time", -bgcolor => "#ffffff" ),
$q->h2( "Current Time" ),
$q->hr,
$q->p( "The current time according to this system is: ",
$q->b( $timestamp ) ),
$q->end_html;

Thanks

[edited by: phranque at 9:01 pm (utc) on Aug. 5, 2008]
[edit reason] hosting specifics [/edit]

 

perl_diver




msg:3715854
 4:54 pm on Aug 5, 2008 (gmt 0)

The code you posted looks OK. If the very first line is correct for your server, it should work. But this is not tech support for your host, you should ask them how to run CGI scripts on their servers. Most web hosts have instructions posted on the website somewhere.

[edited by: phranque at 9:01 pm (utc) on Aug. 5, 2008]
[edit reason] hosting specifics [/edit]

The Contractor




msg:3715860
 5:01 pm on Aug 5, 2008 (gmt 0)

does your error logs show anything?

I have run into some some setups that simple perl files wouldn't work, yet placing use CGI::Carp qw(fatalsToBrowser); in the file made it work? I'm no perl expert ;)

phranque




msg:3716111
 10:19 pm on Aug 5, 2008 (gmt 0)

what is the HTTP response when you GET the script?

medranoenrique




msg:3716772
 4:53 pm on Aug 6, 2008 (gmt 0)

I found how to make CGI scripts into html form by using the command prompt window. So its no longer a problem for me.

[edited by: phranque at 11:26 pm (utc) on Aug. 6, 2008]
[edit reason] removed duplication [/edit]

medranoenrique




msg:3722034
 2:53 pm on Aug 13, 2008 (gmt 0)

The main problem was that I was starting with CGI so I had no idea about what you guys ment by HTTP reponce of error logs and i solved my problem and it was a problem with my variables

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved