LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   passing perl variable into input tag in cgi script (https://www.linuxquestions.org/questions/programming-9/passing-perl-variable-into-input-tag-in-cgi-script-828870/)

shifter 08-27-2010 02:13 PM

passing perl variable into input tag in cgi script
 
How can I to pass a perl variable into html input tag?
For example, If a have got a cgi script:

Quote:

use CGI;
use DBI;


my $owner = $cgi->param('owner');
.....
.....
.....

print "<html>";
.....
.....
print "<form ...>";
.....
print "<input type='hidden' name='profile' value=\"$owner\">";
.....
print "</form>";
print "</html>";
How can I to pass $owner variable?

theNbomr 08-27-2010 06:13 PM

Your example code looks fine to me. What does the resulting HTML looks like? What doesn't do what you expect? Your use of quotes is a bit inconsistent, but I don't think this a cause of problems.

--- rod.


All times are GMT -5. The time now is 12:42 PM.