Gossamer Forum
Home : General : Perl Programming :

javascript/perl

Quote Reply
javascript/perl
Hi

Donīt know if this is difficult, but lets try;

I have a banner with much javacsipt, which I want to put into a script that has this type of code:
--------------------------
# upload routine

sub upload {

print "Content-type: text/html\n\n";
print "<html><head><title>Last opp bilde</title><link rel=STYLESHEET
type=\"text/css\" href=\"$dataurl/style.css\"></head>$body\n";
print "<h1 align=center><i><center>Last
------------------
I have learned how to put wanted code into code that does not have "print..." on each line. (For instance in dbman, with a variable that pointed to a sub), but in this script, it only crash. In dbman, I put this sub/variable after <head> statement, and after the footer.

Anyone knows how the print statement can be removed, or the code added? Maybe include a header/footer statement?

Ask if something in unclear.

Thanks!
---------------
Are

Quote Reply
Re: javascript/perl In reply to
Uh...yea...

Change your codes to the following:

Code:
print "Content-type: text/html\n\n";
print qq|
<html><head><title>Last opp bilde</title><link rel=STYLESHEET
type="text/css" href="$dataurl/style.css"></head>$body
|;

print header;

print qq|
<h1 align=center><i><center>Last
|;

print footer;

print qq|
</body></html>
|;

Hope this helps.

Regards.

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------




[This message has been edited by Eliot (edited December 16, 1999).]
Quote Reply
Re: javascript/perl In reply to
Hi

I just get the message; "The server returned an invalid or unrecongnized response".

This means that a character is not accepted?

Are
Quote Reply
Re: javascript/perl In reply to
print header;

and

print footer;

are refering to subroutines header and footer..

jerry
Quote Reply
Re: javascript/perl In reply to
Or is it possible to input a variable in the print statement. Lets say that you have a sub in the same scipt called sub displayadhead (containing javascript). Why doesnīt this sub get included when i use $displayadhead? I tried using without the ";", but didnīt work. Like this;

----
Code:
print "Content-type: text/html\n\n";
print "<html><head>$displayadhead;<title>e_Match</title>$header\n";
print "<h1 align=center><i><CENTER>e_Match Registration</CENTER></i></h1><hr>\n";
print "<CENTER><B>Before you register, please read <A HREF=\"$main_url/html/disclaimer.htm\" target=_blank>Disclaimer</A></B></CENTER><hr>\n";
print "<B>To register, enter your desired username and complete your valid email address below.</B>\n";
print "<form action=$ENV{'SCRIPT_NAME'} METHOD=POST>\n";
print "<CENTER><table><tr><td>Username:</td><td><input type=text name=name value=\"\"><br></td></tr>\n";
print "<tr><td>E-mail:</td><td><input type=text name=email value=\"\"><B>\n";
---
Quote Reply
Re: javascript/perl In reply to
Nope that will not work.

You need to call a sub-routine in the following manner:

Code:
|;
print &displayheader;
print qq|

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------