Need Help

T

TP

Hi
i have this lines in my html file.. and what it mainly do is list all the
entry in my database...

<form method="listall" action="samp40.cgi">
<input type="submit" value="List All Movies"> </center></form>

what code should i write in my cgi file ... so that when i click on "list
all Movies" it will read the database on my file and print to the
screen!!!!!

thanks
 
G

gnari

TP said:
Hi
i have this lines in my html file.. and what it mainly do is list all the
entry in my database...

<form method="listall" action="samp40.cgi">
<input type="submit" value="List All Movies"> </center></form>

what code should i write in my cgi file ... so that when i click on "list
all Movies" it will read the database on my file and print to the
screen!!!!!

a) you need some way to read the form parameters, (although in this
case there are none to speak of). for this use the CGI module
perldoc CGI

b) you need to read your database info
perdoc -f open

c) then you need to send the results to the browser. (note:
you write 'to the screen in your question, but you mean the browser)
you should print out some HTML with the data in it
perldoc -f print

tell us if you have any problems, we are here to help you.

gnari
 
G

Gunnar Hjalmarsson

TP said:
what code should i write in my cgi file ... so that when i click on
"list all Movies" it will read the database on my file and print to
the screen!!!!!

What have you tried?
 
D

dw

TP said:
<form method="listall" action="samp40.cgi">
<input type="submit" value="List All Movies"> </center></form>

what code should i write in my cgi file ... so that when i click on "list
all Movies" it will read the database on my file and print to the
screen!!!!!

what have you tried? what kind of output do you want? what kind of database
do you have?

coming from a DBI source going to html output using CGI.pm:

print $q->Tr($q->td([@row]) while @row = $sth->fetchrow_array;
 
T

Tad McClellan

TP said:
Subject: Need Help


Need Subject!

Please put the subject of your article in the Subject of your article.

Have you seen the Posting Guidelines that are posted here frequently?

what code should i write in my cgi file


Have you seen what the Perl FAQ has to say about writing CGI programs?


perldoc -q CGI

Where can I learn about CGI or Web programming in Perl?

What is the correct form of response from a CGI script?

My CGI script runs from the command line but not the browser. (500
Server Error)

How can I get better error messages from a CGI program?

How do I make sure users can't enter values into a form that cause my
CGI script to do bad things?

How do I decode a CGI form?


Have you seen what the Perl FAQ has to say about databases and Perl?

perldoc -q database

How do I use an SQL database?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top