LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-27-2010, 02:13 PM   #1
shifter
Member
 
Registered: May 2006
Distribution: Slackware, DragonFly
Posts: 233

Rep: Reputation: 30
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?
 
Old 08-27-2010, 06:13 PM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
passing variable from bash to perl in a bash script quadmore Programming 6 02-21-2011 04:11 AM
passing parameters from cgi script to html page shifter Programming 4 01-18-2010 10:26 AM
Calling perl script and passing variable from php script hosea Programming 5 10-21-2008 08:01 AM
Perl question: Passing variable into function rjcrews Programming 0 10-06-2006 09:24 AM
Passing a variable to a cgi script WindowBreaker Slackware 1 04-03-2006 10:02 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration