Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I have create a html form which takes in a user name and password, if the user name and password are valid a new html page is opened. This contains three buttons which can be selected each calling a new cgi file. The problem is that i want when a button is pressed which leads to a cgi file, i want to them perform a mysql query something like this
$sth = $dbh->prepare(q{SELECT students.grade from students, users wher +e students.id = users.id and users.id = ?}) $usr->execute($username)
The value $username which i want to perform the query on is the value which the user passed in on the very first html page. Is there any secure way of passing that value accross these two pages, or can anybody suggest a better approach that the one i am taking. I would appreciate any help on this matter Thanks

Replies are listed 'Best First'.
Re: passing a value between pages
by rhesa (Vicar) on Dec 11, 2006 at 00:18 UTC
    Use CGI::Session. That way you keep sensitive data on the server.
Re: passing a value between pages
by siva kumar (Pilgrim) on Dec 11, 2006 at 06:34 UTC
    Hi, You can either use CGI::Session or <input type=hidden> to pass the values accross pages. It is better to use CGI::Session for better security.