send a variable from perl to html
Posted by roop (roop), 10 July 2007I have been struggling with this for a while. Any help would be appreciated. Here's the perl snippet that links to the html:
$ewstring = substr($string[$count - 1],3);
$thisrow = $thisrow . "<td>" . $myfont . "<a href=/Operations/all.html#$ewstring style=text-decoration:none><font color=#000000>" . substr($string[$count - 1],3) . "</a>";
The variable $ewstring is created with names found in "all.html". I would like to pass the value in $ewstring and display it at the top of "all.html".
Posted by admin (Graham Ellis), 11 July 2007You'll need to pass in the parameter in the form
And then have the all.html URL point to a Perl (or PHP or something) script to do the substitution. Personally I would go for PHP if it's on your server, as all you would need to do within the HTML is put in something like:
<?php print ($_REQUEST[myval]); >?
That's just a brief intro to the technique needed - you'll need to consider all the various security concerns if $ewstring can contain certain special characters, and to set up your web server to parse the all.html file as .php.
Posted by roop (roop), 11 July 2007Graham,
Thanks for the reply. But I thought all perl variables had to start with "$" and not "?". Or am I missing the obvious? BTW, I am a newbie at perl and html.
Posted by admin (Graham Ellis), 11 July 2007The "?" is the separator between a web page name and the parameters passed into that page as if a form had been filled in - that's the way to send variable data into the next page. Basically, you're saying "I want a variable called myval in th enext page and it will contain what the $ewstring variable conatins on the curent page"
Posted by roop (roop), 11 July 2007Thanks....
This page is a thread posted to the opentalk forum at www.opentalk.org.uk and archived here for reference. To jump to the archive index please follow this link.
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: firstname.lastname@example.org • WEB: http://www.wellho.net • SKYPE: wellho