473,230 Members | 1,381 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,230 software developers and data experts.

pass a perl variable to html

9
I am using a perl script to produce a six element array. When I click a string in the first element, I am linked to a html table (all.html) and the matching string is displayed in the first row of the html table.

This is the variable I am using in the perl script:

$ewstring= substr($string[$count - 1],3);

and this is the link to the html table (all.html):

$thisrow = $thisrow . "<td>" . $myfont . "<a href=/Operations/all.html#$ewstring style=text-decoration:none><font color=#000000>" . substr($string[$count - 1],3) . "</a>";

If I could have highlighted that matched value in the html table I would have done so, but I don't think that can be done in html. I was wondering if I could print that variable string outside the html table so that a user would see what string they selected.

Thanks.
Jul 13 '07 #1
8 5123
KevinADC
4,059 Expert 2GB
I am totally confused, could just be me, it's been a long week, but I have no idea what you are asking or trying to do.
Jul 13 '07 #2
roop1
9
Sorry for the confusion. I would like to pass a perl variable to a html table. In the example I included in my post, $ewstring (in my perl script) is the variable that stored the string that I would like to pass to the html table. Is that a little clearer?

Thanks.
Jul 16 '07 #3
KevinADC
4,059 Expert 2GB
If your perl script is generating and outputting the HTML code all you need do is insert your scalar into the HTML output:


Expand|Select|Wrap|Line Numbers
  1. my $foo = 'Hello World';
  2. print qq~<table><tr><td>$foo</td></tr></table>~; 
Jul 16 '07 #4
roop1
9
Thanks but I am still confused. If I may I will try to explain further.
These two lines in my perl script:

$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>";

produce the following table:

01TTERRORS_TCP_from_MIS Up Up 51 Jul 16 10:04:45 0
01TTERRORS_from_PHARM Up Up 0 Jul 16 08:01:37 0
01TTLABORDERADT_TCP_from_MIS Up Up 2326 Jul 16 14:14:05 0
01TTMSGS_eater Up - 51 Jul 16 10:04:45 0

When I click on say "01TTLABORDERADT_TCP_from_MIS" from the above table, then the following html table is displayed:

Dept Error Coverage Contact Notes
01TT-eater External: 01TTMSGS_eater 0900-1700 x 5 See DC.OPS.DOC@INTFACE
01TT-MIS External: 01TTERRORS_TCP_from_MIS 24 x 7 Tech Support on-call
External: 01TTLABORDERADT_TCP_from_MIS 24 x 7 Tech Support on-call
External: 01TTRESULTS_TCP_to_MIS 24 x 7 Tech Support on-call

I would like to print the string "01TTLABORDERADT_TCP_from_MIS" at the top of the html table i.e. above the column headings. Example:

01TTLABORDERADT_TCP_from_MIS
Dept Error Coverage Contact Notes
01TT-eater External: 01TTMSGS_eater 0900-1700 x 5 See DC.OPS.DOC@INTFACE
01TT-MIS External: 01TTERRORS_TCP_from_MIS 24 x 7 Tech Support on-call
External: 01TTLABORDERADT_TCP_from_MIS 24 x 7 Tech Support on-call
External: 01TTRESULTS_TCP_to_MIS 24 x 7 Tech Support on-call

Is this more confusing?

Thanks.
Jul 16 '07 #5
KevinADC
4,059 Expert 2GB
You seem to be quite confused. What are you expecting this to do?

<a href=/Operations/all.html#$ewstring

thaat just looks like an internal anchor that jumps to a certain part of the existing html page. It can't do anything besides that.
Jul 16 '07 #6
roop1
9
Exactly. That is all I want it to do, nothing else. However, I would like to print $ewstring on top of the existing html page, if that's possible.....Perhaps it's not.
Jul 17 '07 #7
KevinADC
4,059 Expert 2GB
It is possible but you would have to send the data back to the server, parse it, and reprint the page on the fly. Another possibility is to incorporate some DHTML/javascript into the html code that will handle the printing of the table name. But then you have the task of learnng DHTML/javascript and how to get it into your html output or asking on a DHTML/avascript forum (my javascript experience is very limited). A third possibility is AJAX, something I know next to nothing about.
Jul 17 '07 #8
roop1
9
Thanks for you help. I thought this would be a whole lot more than I can handle. But I needed confirmation.

Thanks again....
Jul 18 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: FLEB | last post by:
I like PHP for its excellent inline integration into standard HTML files, but I like Perl for its quick-moving syntax and simpler data-processing. To resolve this deep-seated inner turmoil (oh, the...
46
by: Reinhold Birkenfeld | last post by:
Hello, another Perl/Python question: the subject says it all. Perl is going to change dramatically to become a more powerful and easier to (read|write) language. Is Python taking a similar...
2
by: pleaseexplaintome | last post by:
Hi I have the following perl/cgi script snippet. The goal of this script is to pass a javascript variable to perl where it can be re-used later. Any help is appreciated, Thanks ...
0
by: alpha122 | last post by:
I am beginner and I need some help writing simple perl script. I need to get url query and pass it to the javascript function as parameter. for example: my page will be...
1
by: adpinc | last post by:
Hello all! I am a seasoned programmer, but not really with Javascript. I have a strange phenomenon going on that for the life of me I cannot figure out what is wrong. I am calling a javascript...
3
by: sisqorap | last post by:
Hi all, I have this kind of warning and would like to have it solved: Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration...
2
by: nriv08 | last post by:
Ok i've done lots of searching on google and i can't seem to find my answer. i have an html/php page that submits a string and stores it into a variable array via my php script. I want to pass...
66
by: happyse27 | last post by:
Hi All, my html code is sno 1) and perl code is sno 2). a) I tried to print $filename and it cant print out the value, only blank was displayed, and the file could not be uploaded. And it...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.