Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Help a newb with Perl CGI forms [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
brent_weaver
Guru
Guru


Joined: 01 Jul 2004
Posts: 501
Location: Burlington, VT

PostPosted: Tue Nov 27, 2012 12:20 pm    Post subject: Help a newb with Perl CGI forms [solved] Reply with quote

Hello there. I am new to Perl CGI (not base perl) and need to create a two field. Both are really free text fields. The issue I have is getting the text boxes to be one on top of the other (as opposed to horizontal). This is the code I have:

Code:

#!/usr/bin/perl

use strict;
use warnings;
use Config::IniFiles;
use CGI qw/:standard/;
use vars qw ( @TMP $TITLE $CUR );

$TITLE = "Nagios On-Call Update";

if ( -e "/var/nssoncall/oncall.ini" ) {

        open(IN,"</var/nssoncall/oncall.ini");
        @TMP = <IN>;
        close IN;

        $TITLE = $TITLE . " [Current = $TMP[0]] ";
        }

print header,
        start_html('Nagios On-Call Updater'),title('NagiosOnCall'),
        hr,
             h1($TITLE),
                start_form,
                textfield( -name => 'address', -size => 40, -maxlength => 40),
                textfield( -name => 'name', -size => 40, -maxlength => 40),
                submit(-name=>'Activate'),
                end_form,
                ;

if (param()) {
        my $address   = param('address');
        my $name      = param('name');
        system "echo $address > /var/nssoncall/oncall.ini";
        print "<meta http-equiv=\"REFRESH\" content=\"0;url=/nagios/cgi-bin/oncall.cgi\">";
        }


As always, any help is much appreciated!
_________________
Brent Weaver


Last edited by brent_weaver on Thu Nov 29, 2012 12:59 pm; edited 1 time in total
Back to top
View user's profile Send private message
Ant P.
Advocate
Advocate


Joined: 18 Apr 2009
Posts: 2207
Location: UK

PostPosted: Wed Nov 28, 2012 1:56 am    Post subject: Reply with quote

Sounds like you want a HTML <br> tag after the first one.
Back to top
View user's profile Send private message
brent_weaver
Guru
Guru


Joined: 01 Jul 2004
Posts: 501
Location: Burlington, VT

PostPosted: Thu Nov 29, 2012 1:03 pm    Post subject: Reply with quote

Thank you for the response!
_________________
Brent Weaver
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum