P
pmcgover
I enjoyed Paul Barry's September article in Linux Journal entitled,
"Web Reporting with MySQL, CSS and Perl". It provides a simple,
elegant way to use HTML to display database content without any sql
markup in the cgi script. The cgi script simply calls the Mysql
command line with the HTML option (-H) and the SQL script file directed
to that command. This provides complete separation of the markup from
the sql code. The plain vanila HTML output can be spruced up with CSS
to provide more color and size control of the HTML.
This model could be much more powerful if you could pass an SQL query
parameter from the user to the sql script. I attempted this by
substituting the string "p_1" in the where clause of the sql code but I
could not substitute this string with the value in the cgi code (ie.
$query =~ s/p_1/value_variable/.
Any ideas how this could be made to work? Would it be a security
issue, or is it still possible to "taint" the user input value?
Thanks!
Below is a link to the article:
http://delivery.acm.org/10.1145/116...coll=ACM&dl=ACM&CFID=15151515&CFTOKEN=6184618
"Web Reporting with MySQL, CSS and Perl". It provides a simple,
elegant way to use HTML to display database content without any sql
markup in the cgi script. The cgi script simply calls the Mysql
command line with the HTML option (-H) and the SQL script file directed
to that command. This provides complete separation of the markup from
the sql code. The plain vanila HTML output can be spruced up with CSS
to provide more color and size control of the HTML.
This model could be much more powerful if you could pass an SQL query
parameter from the user to the sql script. I attempted this by
substituting the string "p_1" in the where clause of the sql code but I
could not substitute this string with the value in the cgi code (ie.
$query =~ s/p_1/value_variable/.
Any ideas how this could be made to work? Would it be a security
issue, or is it still possible to "taint" the user input value?
Thanks!
Below is a link to the article:
http://delivery.acm.org/10.1145/116...coll=ACM&dl=ACM&CFID=15151515&CFTOKEN=6184618