Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Any security holes?

by marto (Cardinal)
on Jun 28, 2022 at 08:57 UTC ( [id://11145129]=note: print w/replies, xml ) Need Help??


in reply to Any security holes?

Security aside

open(my $fh, '>>', 'drivers.html');

Why not have open tell you why something failed? ...or die "File append failure: $!";

print "Content-type:text/html\r\n\r\n";

Why are you adding this for every entry? There should be a single Content-Type header. HTML files don't need a content type header, but should be valid, what you're writing isn't.

It'd make a lot more sense to store these values in a database, and display using a template. It looks like you're getting started, I'd suggest not using CGI, if you want to make web development fun and avoid footguns I'd suggest looking at Mojolicious::Lite (Tutorial) with DBD::SQLite, also CGI::Alternatives.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-04-23 23:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found