This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/perl-Tw | |
| use strict; | |
| print "Content-type: text/html\n\n"; | |
| print "Hello World!\n"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/perl -Tw | |
| use cPanelUserConfig; | |
| use CGI; | |
| use DBI; | |
| $dbh = DBI->connect('DBI:mysql:NameofDatabase', 'NameofUser', 'passwordofUser' | |
| ) || die "Could not connect to database: $DBI::errstr"; | |
| $dbh->do('CREATE TABLE exmpl_tbl (id INT, val VARCHAR(100))'); | |
| $dbh->do('INSERT INTO exmpl_tbl VALUES(1, ?)', undef, 'Hello'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="UTF-8"> | |
| </head> | |
| <body> | |
| <div> | |
| <form method="post" action="/cgi-bin/login.pl"> | |
| <p>Username:</p><input type="text" name="username" value="" maxlength="40" required autofocus></br> | |
| <p>Password:</p><input type="password" name="password" value="" maxlength="40" required></br> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/perl -Tw | |
| use strict; | |
| use CGI; | |
| use CGI::Carp qw(fatalsToBrowser); # show errors in browser, can be removed later | |
| #Catching and Holding the incoming data | |
| my $cgi = CGI->new; | |
| my $username = undef; | |
| $username = $cgi->param("username"); | |
| my $password = undef; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ sudo stat -f '%Lp%t%N' /usr/local/www/apache24/site/ * | |
| 644 /usr/local/www/apache24/fileA.html | |
| 644 /usr/local/www/apache24/fileB.html | |
| 755 /usr/local/www/apache24/cgi | |
| 644 /usr/local/www/apache24/fileC.html | |