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 "<H1>HELLO</H1><P>";
print "<B>Welcome</B> to the site!";
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 "EOHTML" 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="parked_domain_form" method="post" action="cadmin.cgi">
$TXT{'which_domain_name'}
<input name="domainname" type="text" id="domainname" value="$domainname"><P>
$TXT{'which_soa_value'}
<SELECT name="soavalue" value="$soavalue">
<OPTION>com
<OPTION>de
</SELECT><P>
$TXT{'which_login_name'}
<input name="login" type="text" id="login" value="$login"><P>
$TXT{'which_login_to_park_on'}
<input name="parkedlogin" type="text" id="parkedlogin" value="$parkedlogin"><P>
$TXT{'which_password'}
<input name="password" type="text" id="password"><P>
$TXT{'which_own_folder'}
<input name="separater_ordner" type="text" id="separater_ordner" value="$separater_ordner"><P>
<input type="hidden" name="menuoption" value="2">
<input type="submit" name="SubmitParkedDomain" value="$TXT{'submit_the_parked_domain'}">
</form>
<P><A HREF="cadmin.cgi">$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 "Content-type: text/html\n\n";
print <<EOHTML;
<BODY>
<H1>$TXT{'create_new_parked_domain'}</H1><P>
<form name="parked_domain_form" method="post" action="cadmin.cgi">
$TXT{'which_domain_name'}
<input name="domainname" type="text" id="domainname" value="$domainname"><P>
$TXT{'which_soa_value'}
<SELECT name="soavalue" value="$soavalue">
<OPTION>com
<OPTION>de
</SELECT><P>
$TXT{'which_login_name'}
<input name="login" type="text" id="login" value="$login"><P>
$TXT{'which_login_to_park_on'}
<input name="parkedlogin" type="text" id="parkedlogin" value="$parkedlogin"><P>
$TXT{'which_password'}
<input name="password" type="text" id="password"><P>
$TXT{'which_own_folder'}
<input name="separater_ordner" type="text" id="separater_ordner" value="$separater_ordner"><P>
<input type="hidden" name="menuoption" value="2">
<input type="submit" name="SubmitParkedDomain" value="$TXT{'submit_the_parked_domain'}">
</form>
<P><A HREF="cadmin.cgi">$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!
print << EOHTML....
EOHTML
Changing for eg this:
print "<H1>HELLO</H1><P>";
print "<B>Welcome</B> to the site!";
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 "EOHTML" 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="parked_domain_form" method="post" action="cadmin.cgi">
$TXT{'which_domain_name'}
<input name="domainname" type="text" id="domainname" value="$domainname"><P>
$TXT{'which_soa_value'}
<SELECT name="soavalue" value="$soavalue">
<OPTION>com
<OPTION>de
</SELECT><P>
$TXT{'which_login_name'}
<input name="login" type="text" id="login" value="$login"><P>
$TXT{'which_login_to_park_on'}
<input name="parkedlogin" type="text" id="parkedlogin" value="$parkedlogin"><P>
$TXT{'which_password'}
<input name="password" type="text" id="password"><P>
$TXT{'which_own_folder'}
<input name="separater_ordner" type="text" id="separater_ordner" value="$separater_ordner"><P>
<input type="hidden" name="menuoption" value="2">
<input type="submit" name="SubmitParkedDomain" value="$TXT{'submit_the_parked_domain'}">
</form>
<P><A HREF="cadmin.cgi">$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 "Content-type: text/html\n\n";
print <<EOHTML;
<BODY>
<H1>$TXT{'create_new_parked_domain'}</H1><P>
<form name="parked_domain_form" method="post" action="cadmin.cgi">
$TXT{'which_domain_name'}
<input name="domainname" type="text" id="domainname" value="$domainname"><P>
$TXT{'which_soa_value'}
<SELECT name="soavalue" value="$soavalue">
<OPTION>com
<OPTION>de
</SELECT><P>
$TXT{'which_login_name'}
<input name="login" type="text" id="login" value="$login"><P>
$TXT{'which_login_to_park_on'}
<input name="parkedlogin" type="text" id="parkedlogin" value="$parkedlogin"><P>
$TXT{'which_password'}
<input name="password" type="text" id="password"><P>
$TXT{'which_own_folder'}
<input name="separater_ordner" type="text" id="separater_ordner" value="$separater_ordner"><P>
<input type="hidden" name="menuoption" value="2">
<input type="submit" name="SubmitParkedDomain" value="$TXT{'submit_the_parked_domain'}">
</form>
<P><A HREF="cadmin.cgi">$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!