Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTML Output Problem

Status
Not open for further replies.

iaresean

Programmer
Mar 24, 2003
570
ZA
Hey all I am busy converting my code to make it a bit more readable. I am changing all my print statements that contain html code by removing the print and placing my html code between
print << EOHTML....
EOHTML

Changing for eg this:
print &quot;<H1>HELLO</H1><P>&quot;;
print &quot;<B>Welcome</B> to the site!&quot;;

To this:
print << EOHTML;
<H1>HELLO</H1><P>
<B>Welcome</B> to the site!
EOHTML

But I have a problem, as soon as I started applying this I got the following error:
Can't find string terminator &quot;EOHTML&quot; anywhere before EOF at /home/httpd/cgi-bin/cadmin.cgi line 1368.

Here is my code:

sub setupParkedForm(){
print <<EOHTML;
<BODY>
<H1>$TXT{'create_new_parked_domain'}</H1><P>

<form name=&quot;parked_domain_form&quot; method=&quot;post&quot; action=&quot;cadmin.cgi&quot;>
$TXT{'which_domain_name'}
<input name=&quot;domainname&quot; type=&quot;text&quot; id=&quot;domainname&quot; value=&quot;$domainname&quot;><P>
$TXT{'which_soa_value'}
<SELECT name=&quot;soavalue&quot; value=&quot;$soavalue&quot;>
<OPTION>com
<OPTION>de
</SELECT><P>
$TXT{'which_login_name'}
<input name=&quot;login&quot; type=&quot;text&quot; id=&quot;login&quot; value=&quot;$login&quot;><P>
$TXT{'which_login_to_park_on'}
<input name=&quot;parkedlogin&quot; type=&quot;text&quot; id=&quot;parkedlogin&quot; value=&quot;$parkedlogin&quot;><P>
$TXT{'which_password'}
<input name=&quot;password&quot; type=&quot;text&quot; id=&quot;password&quot;><P>
$TXT{'which_own_folder'}
<input name=&quot;separater_ordner&quot; type=&quot;text&quot; id=&quot;separater_ordner&quot; value=&quot;$separater_ordner&quot;><P>
<input type=&quot;hidden&quot; name=&quot;menuoption&quot; value=&quot;2&quot;>
<input type=&quot;submit&quot; name=&quot;SubmitParkedDomain&quot; value=&quot;$TXT{'submit_the_parked_domain'}&quot;>
</form>

<P><A HREF=&quot;cadmin.cgi&quot;>$TXT{'back_to_main'}</A>
</BODY>
EOHTML
}


Could the error have something to do with using a sub procedure?

I transfered this exact code into a blank script without the sub and it worked. That script looks like this:

#!/usr/bin/perl

print &quot;Content-type: text/html\n\n&quot;;

print <<EOHTML;
<BODY>
<H1>$TXT{'create_new_parked_domain'}</H1><P>

<form name=&quot;parked_domain_form&quot; method=&quot;post&quot; action=&quot;cadmin.cgi&quot;>
$TXT{'which_domain_name'}
<input name=&quot;domainname&quot; type=&quot;text&quot; id=&quot;domainname&quot; value=&quot;$domainname&quot;><P>
$TXT{'which_soa_value'}
<SELECT name=&quot;soavalue&quot; value=&quot;$soavalue&quot;>
<OPTION>com
<OPTION>de
</SELECT><P>
$TXT{'which_login_name'}
<input name=&quot;login&quot; type=&quot;text&quot; id=&quot;login&quot; value=&quot;$login&quot;><P>
$TXT{'which_login_to_park_on'}
<input name=&quot;parkedlogin&quot; type=&quot;text&quot; id=&quot;parkedlogin&quot; value=&quot;$parkedlogin&quot;><P>
$TXT{'which_password'}
<input name=&quot;password&quot; type=&quot;text&quot; id=&quot;password&quot;><P>
$TXT{'which_own_folder'}
<input name=&quot;separater_ordner&quot; type=&quot;text&quot; id=&quot;separater_ordner&quot; value=&quot;$separater_ordner&quot;><P>
<input type=&quot;hidden&quot; name=&quot;menuoption&quot; value=&quot;2&quot;>
<input type=&quot;submit&quot; name=&quot;SubmitParkedDomain&quot; value=&quot;$TXT{'submit_the_parked_domain'}&quot;>
</form>

<P><A HREF=&quot;cadmin.cgi&quot;>$TXT{'back_to_main'}</A>
</BODY>

EOHTML


Could it possibly have something to do with me using the CGI module in my original script. Any ideas. Please let me know. For now I am gonna leave my script as is till I solve this problem.

A big thanks to anyone who even took the time to read through this long winded post! ;)
 
put a hard return after the EOHTML and it will (should) be fine - I checked it & it did work


Regards
Duncan
 
Do you mean a carriage return i.e. Hit the enter key?
If so, I tried this and it still didn't work. Give me an example if you can.
Thank you.
 
Damn I just found my problem:

Instead of this:
sub setupParkedForm(){
print <<EOHTML;
<BODY>
<H1>$TXT{'create_new_parked_domain'}</H1><P>

<form name=&quot;parked_domain_form&quot; method=&quot;post&quot; action=&quot;cadmin.cgi&quot;>
$TXT{'which_domain_name'}
<input name=&quot;domainname&quot; type=&quot;text&quot; id=&quot;domainname&quot; value=&quot;$domainname&quot;><P>
$TXT{'which_soa_value'}
<SELECT name=&quot;soavalue&quot; value=&quot;$soavalue&quot;>
<OPTION>com
<OPTION>de
</SELECT><P>
$TXT{'which_login_name'}
<input name=&quot;login&quot; type=&quot;text&quot; id=&quot;login&quot; value=&quot;$login&quot;><P>
$TXT{'which_login_to_park_on'}
<input name=&quot;parkedlogin&quot; type=&quot;text&quot; id=&quot;parkedlogin&quot; value=&quot;$parkedlogin&quot;><P>
$TXT{'which_password'}
<input name=&quot;password&quot; type=&quot;text&quot; id=&quot;password&quot;><P>
$TXT{'which_own_folder'}
<input name=&quot;separater_ordner&quot; type=&quot;text&quot; id=&quot;separater_ordner&quot; value=&quot;$separater_ordner&quot;><P>
<input type=&quot;hidden&quot; name=&quot;menuoption&quot; value=&quot;2&quot;>
<input type=&quot;submit&quot; name=&quot;SubmitParkedDomain&quot; value=&quot;$TXT{'submit_the_parked_domain'}&quot;>
</form>

<P><A HREF=&quot;cadmin.cgi&quot;>$TXT{'back_to_main'}</A>
</BODY>
EOHTML
}

It had to be:

sub setupParkedForm(){
print <<EOHTML;
<BODY>
<H1>$TXT{'create_new_parked_domain'}</H1><P>

<form name=&quot;parked_domain_form&quot; method=&quot;post&quot; action=&quot;cadmin.cgi&quot;>
$TXT{'which_domain_name'}
<input name=&quot;domainname&quot; type=&quot;text&quot; id=&quot;domainname&quot; value=&quot;$domainname&quot;><P>
$TXT{'which_soa_value'}
<SELECT name=&quot;soavalue&quot; value=&quot;$soavalue&quot;>
<OPTION>com
<OPTION>de
</SELECT><P>
$TXT{'which_login_name'}
<input name=&quot;login&quot; type=&quot;text&quot; id=&quot;login&quot; value=&quot;$login&quot;><P>
$TXT{'which_login_to_park_on'}
<input name=&quot;parkedlogin&quot; type=&quot;text&quot; id=&quot;parkedlogin&quot; value=&quot;$parkedlogin&quot;><P>
$TXT{'which_password'}
<input name=&quot;password&quot; type=&quot;text&quot; id=&quot;password&quot;><P>
$TXT{'which_own_folder'}
<input name=&quot;separater_ordner&quot; type=&quot;text&quot; id=&quot;separater_ordner&quot; value=&quot;$separater_ordner&quot;><P>
<input type=&quot;hidden&quot; name=&quot;menuoption&quot; value=&quot;2&quot;>
<input type=&quot;submit&quot; name=&quot;SubmitParkedDomain&quot; value=&quot;$TXT{'submit_the_parked_domain'}&quot;>
</form>

<P><A HREF=&quot;cadmin.cgi&quot;>$TXT{'back_to_main'}</A>
</BODY>
EOHTML
}

I.E. The EOHTML has to have no spaces before it. I think if their are spaces before it it is included in the string and the browser is unable to find an exact match of &quot;EOHTML&quot; instead it finds &quot; EOHTML&quot;.

Thanks for the help though.
 
Your 2nd example in your 1st posting didn't have any spaces before the EOHTML - but the 1st one did - I used the 2nd one so I didn't replicate that problem

Duncan
 
Thanks anyway duncdude, I am sure you would have solved it anyways.
 
Yea, thats one problem with html forums, unless you wrap your examples in pre tags you won't get the real picture.

 
Good point siberian - I hadn't thought of that!

Cheers
Duncan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top