print "<font size=\4\"> welcome $ surname $name</font size><br><br> Please choose a username for the site and a password<br><br><br><form action=\"password.pl?id='$id'&unicode='$university'\" method=\"post\" target=\"mainFrame\">Username: <input type=\"text\" name=\"username\" size=\"15\"><br><br><br>
Password: <input type=\"text\" name=\"password\" size=\"15\"><br><br><br><center>
<input type=\"submit\" value=\"Submit\"></form></center>";
}
$id and $university having been captured earlier in the code as
$id=param("id");
$university=param("university");
The password perl file was then the following:
#!c:/perl/bin/perl.exe
use DBI;
$,="\t";
use CGI ":standard";
$username=param("username");
$password=param("password");
$id=param("id");
$unicode=param("unicode");
print"content-type:text/html\n\n";
print"<html>\n";
print"<body bgcolor=\"#990000\"><font color=\"white\">";
$db=DBI->connect("dbi:mysql:administration") or die"\n Error($DBI::err):$DBI::errstr\n";
$update="INSERT into password values('$username','$password','$id','$unicode')";
$s=$db->do($update);
print"<b><font color=\"white\">Database updated</font color></b>";
$s->finish();
$db->disconnect();
This didn't work as the database only recorded $username and $password but not the other two.
It does work if in the first file I use hidden text:
print "<font size=\4\"> welcome $ surname $name</font size><br><br> Please choose a username for the site and a password<br><br><br><form action=\"password.pl\" method=\"post\" target=\"mainFrame\">Username: <input type=\"text\" name=\"username\" size=\"15\"><br><br><br>
Password: <input type=\"text\" name=\"password\" size=\"15\"><br><br><br><center>
<input type=\"hidden\" name=\"id\" value=\"$id\"> <input type=\"hidden\" name=\"unicode\" value=\"$university\"><input type=\"submit\" value=\"Submit\"></form></center>" ;
But I would prefer not to have to do this and pass it as parameters. Could anyone tell me what I did wrong in my first script?
Thank you