homepage Welcome to WebmasterWorld Guest from 54.197.183.230
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
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

5+ Year Member



 
Msg#: 3715835 posted 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

5+ Year Member



 
Msg#: 3715835 posted 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

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 3715835 posted 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

WebmasterWorld Administrator phranque us a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



 
Msg#: 3715835 posted 10:19 pm on Aug 5, 2008 (gmt 0)

what is the HTTP response when you GET the script?

medranoenrique

5+ Year Member



 
Msg#: 3715835 posted 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

5+ Year Member



 
Msg#: 3715835 posted 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.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved