Welcome to Dream.In.Code
Getting Help is Easy!

Join 86,373 Programmers. There are 1,430 online right now! Ask your question and get quick answers from Dream.In.Code experts. Join the #1 programming help community on the internet! Registration is fast and FREE... Join Now!

Chat LIVE With a Expert
Powered by LivePerson.com

Register to Make This Box Go Away!

Problems with viewing perl in Firefox AND Internet Explorer

 
Reply to this topicStart new topic

Problems with viewing perl in Firefox AND Internet Explorer

scottyadam
post 27 Apr, 2008 - 08:01 PM
Post #1


New D.I.C Head

*
Joined: 3 Dec, 2007
Posts: 38



Ok,

So what I am doing here is, I have a text file that is read in through perl code:

CODE
open (GUESTBOOK, "adamscott_info.txt");
chomp(@guest = <GUESTBOOK>);
close (GUESTBOOK);
foreach $line (@guest) {
    @value = split('::', $line);
    $age = $value[0];
    $boat = $value[1];
    $year = $value[2];
    $nickname = $value[3];
    $wave = $value[4];
    $hole = $value[5];
    $river = $value[6];
    $sponsor = $value[7];
    $message = $value[8];
}


The problem is, I am trying to display the value of $boat in the "VALUE" part of an input box like this:

CODE
print "<input type=\"text\" name=\"boat\" size=\"34\" style=\"font-weight:bold;\" value=\"$boat\">";


and here is the webpage that I tried this code out...view it in Internet Explorer and Firefox...there is a difference but I can't figure out how to make the "VALUE" appear in firefox also...it is really weird...any ideas?

http://www.airbornathletics.com/team/webpage_edit.pl

Here is the text file that goes along with it:

http://www.airbornathletics.com/team/adamscott_info.txt

By the way...so I don't have to post it here is the code for webpage_edit.pl:

CODE
#!/usr/bin/perl

use CGI::Carp qw(fatalsToBrowser); # This line it doesn't seam to make a difference with or without?!?!
print "Content-type: text/html\n\n";

open (GUESTBOOK, "adamscott_info.txt");
chomp(@guest = <GUESTBOOK>);
close (GUESTBOOK);
foreach $line (@guest) {
    @value = split('::', $line);
    $age = $value[0];
    $boat = $value[1];
    $year = $value[2];
    $nickname = $value[3];
    $wave = $value[4];
    $hole = $value[5];
    $river = $value[6];
    $sponsor = $value[7];
    $message = $value[8];
}


print "<html>";
print "<body>";
print "<input type=\"text\" name=\"sponsors\" size=\"34\" style=\"font-weight:bold;\" value=\"$boat\">";
print "$wave";
print "</body>";
print "</html>";


Thanks...
User is offlineProfile CardPM
Go to the top of the page
+Quote Post


KevinADC
post 27 Apr, 2008 - 09:13 PM
Post #2


D.I.C Head

Group Icon
Joined: 23 Jan, 2007
Posts: 168

If there is more than one line in the file you are only getting the value from the last line. Maybe you should only be splitting the first line of the file.

An <input> tag should also be embedded between an opening and a closing <form> tag.

This post has been edited by KevinADC: 27 Apr, 2008 - 09:16 PM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

scottyadam
post 28 Apr, 2008 - 04:25 AM
Post #3


New D.I.C Head

*
Joined: 3 Dec, 2007
Posts: 38

You are the man KevinADC. Thanks it is gloriously working....

That is all it needed....I just hate the fact that Internet Explorer and Firefox and so different....it really annoys me...lol

oh yeah...the problem was with the input tags it turns out...I had to put the <form> tag in there and it worked

Thanks Again!

This post has been edited by scottyadam: 28 Apr, 2008 - 04:27 AM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 5/17/08 02:42AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month