Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Start Simple Before - Trying to output mysql query to browser

by metadoktor (Hermit)
on Jan 31, 2002 at 22:41 UTC ( [id://142537]=note: print w/replies, xml ) Need Help??


in reply to Trying to output mysql query to browser

First of all, have you done any CGI programming before? If not, then start out with a very very simple example or learn to use CGI if you don't feel comfortable with the not so esoteric art of CGI programming.

IMPORTANT! Before you run that CGI script of yours on the web first try to run it from your command line prompt like so:

C:\> perl -w mycgiscript.pl
If you get NO ERRORS and you get the output that you're expecting then you can try invoking your CGI script from a browser.

You should start out using something simple like this:

#!D:\Perl\bin\perl -wT use strict; print "Content-Type: text/html\n\n"; print "<html><body>\n"; print "Hello World!\n"; print "</body></html>\n";

And gradually add a SQL query or whatever and you'll obviously want to make sure that you output correct HTML which would include the DOCTYPE header.

Also, don't forget about SECURITY. Be careful in what you accept from the browser, if anything.

metadoktor

"The doktor is in."

Replies are listed 'Best First'.
Re: Start Simple Before ... Trying to output mysql query to browser
by Johnny_bike (Initiate) on Feb 01, 2002 at 08:16 UTC
    Thanks to everybody for those comments, most helpful
    I do not want to run before I can walk but I also want to produce my web page as quickly as possible and then learn a bit more afterwards.
    I have checked out Ovid's course and that looks good so I will spend a bit of time on that.
    Thanks again for your time, I am sure you will hear from me again
    John

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://142537]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2024-03-28 12:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found