Help needed on reading HTML file and generate Pages using CGI (newbie) 
Author Message
 Help needed on reading HTML file and generate Pages using CGI (newbie)

 Hi all,

 I need help on reading a HTML file and generate a page using CGI. To better
explain my situation, I created a html file using Microsoft Frontpage and i
 wanted to create a CGI that will read that file "line-by-line" and generate
the page. The steps i have figured out but have no idea of the correct CGI
codes:

 open the html file
 read html file line-by-line
 print each line till EOF

 This must sound weird, but i wanted to make it easier for me to change the
HTML output of the page, without changing the Codes in the CGI. The CGI is
 also using Perl.

 Thanks All, and help would be really apreciated.

 Marbeen



Sat, 29 Nov 2003 15:48:51 GMT  
 Help needed on reading HTML file and generate Pages using CGI (newbie)
ok, let's see now...

Quote:

>  Hi all,

>  I need help on reading a HTML file and generate a page using CGI. To better
> explain my situation, I created a html file using Microsoft Frontpage

Here we have the first mistake.... Never use Frontpage to create HTML.... it
just makes bs out of IT, with loads of IE only working stuff.....

Quote:
> and i
>  wanted to create a CGI that will read that file "line-by-line" and generate
> the page.

Why don't you just load the page?

Quote:
>  This must sound weird, but i wanted to make it easier for me to change the
> HTML output of the page, without changing the Codes in the CGI. The CGI is
>  also using Perl.

That does sound weird indeed. Do you want to make a html file that will be used
as a template, so that the CGI reads this, does it's magic and then makes a page
using the html file as a template?


Sat, 29 Nov 2003 16:44:47 GMT  
 Help needed on reading HTML file and generate Pages using CGI (newbie)
Exactly....creating the template will make it easier, suppose i need to
change the layout of the entire web site.


Quote:
> ok, let's see now...


> >  Hi all,

> >  I need help on reading a HTML file and generate a page using CGI. To
better
> > explain my situation, I created a html file using Microsoft Frontpage

> Here we have the first mistake.... Never use Frontpage to create HTML....
it
> just makes bs out of IT, with loads of IE only working stuff.....

> > and i
> >  wanted to create a CGI that will read that file "line-by-line" and
generate
> > the page.

> Why don't you just load the page?

> >  This must sound weird, but i wanted to make it easier for me to change
the
> > HTML output of the page, without changing the Codes in the CGI. The CGI
is
> >  also using Perl.

> That does sound weird indeed. Do you want to make a html file that will be
used
> as a template, so that the CGI reads this, does it's magic and then makes
a page
> using the html file as a template?



Sat, 29 Nov 2003 17:46:28 GMT  
 Help needed on reading HTML file and generate Pages using CGI (newbie)
Something like this?


my $count = 0;
my $lineCount;


close(FILE);


while ($count < $lineCount)
{
   print $text[$count++], "";

Quote:
}



Mon, 01 Dec 2003 02:38:35 GMT  
 Help needed on reading HTML file and generate Pages using CGI (newbie)

Quote:

> Something like this?


> my $count = 0;
> my $lineCount;

> open(FILE, 'file.txt') or die "Can't open file.txt: $!";

> close(FILE);


> while ($count < $lineCount)
> {
>    print $text[$count++], "";
> }

open (FILE, '<$filename');
print <FILE>;
close (FILE);


Mon, 01 Dec 2003 07:30:41 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. newbie alert: generating html output without using cgi.pm

2. how to insert an HTML page into another perl generated HTML page

3. Newbie -- Read from text file write to current html page

4. Using Perl to generate HTML Pages.

5. generating customised html page from the output of cgi-perl script

6. HELP with accessing HTML page to automate Login using HTML::Form

7. generating a HTML form using CGI.pm

8. Newbie need help with reading data file...

9. Newbie: Need help parsing html file for links

10. (newbie) Problem generating .html files from perl-script

11. Need to read a html page and save it via perl Unable to Use LWP

12. Need help using hash to read file/array

 

 
Powered by phpBB® Forum Software