Hi,
I work on a simple contactscript but I have a hard parse error and can't find it.
My code:
?
session_start;
#################################################
## contact.php
## Contactformulier voor bezoekers.
## Versie 2.0
##################################################
error_reportingE_ALL;
requirevlib/vlibTemplate.php;
requirevlib/vlibMimeMail.php;
requireinc/config.inc.php;
requireinc/functions.php;
# Template stuff
$tmpl = new vlibTemplateDebug'templates/contact.html';
if$_POST
$tmpl-setVar'post', 1;
# Begin foutcontrole
$foutje = 0;
ifempty$_POST'van_naam'
$tmpl-setVar'empty_van_naam', 1;
$foutje = 1;
ifempty$_POST'van_email'
$tmpl-setVar'empty_van_email', 1;
$foutje = 1;
if!ereg^A-Za-z0-9_-+@A-Za-z0-9_-+.A-Za-z0-9_-+.*, $_POST'van_email'
$tmpl-setVar'error_van_email', 1;
$foutje = 1;
ifempty$_POST'onderwerp'
$tmpl-setVar'empty_subject', 1;
$foutje = 1;
ifempty$_POST'bericht'
$tmpl-setVar'empty_bericht', 1;
$foutje = 1;
if$foutje == 0
# No errors, send mail
$p-email = $_POST'van_email';
$p-name = $_POST'van_naam';
$p-subject = $_POST'onderwerp';
$p-message = $_POST'bericht';
$mail= new vlibMimeMail;
$mail-to'
[email protected]', 'F2B Staff;
$mail-from$p-email, $p-name;
$p-subject = F2B-.$site-host.-.$p-subject;
$mail-subject$p-subject;
$p-message = nl2br$p-message;
$p-message = strip_tags$p-message;
$mail-body$p-message;
$mail-send;
$p-message = nl2br$p-message;
# Parse error parse error in /opt/www/user/web/ssr_site/contact.php on line 78
$tmpl-setVar'mail_message', $p-message;
$tmpl-setVar'send', 1;
else
# Errors were found, send no e-mail
else
# Show form
$tmpl-pparse;
?
I get Parse error: parse error in /opt/www/user/web/ssr_site/contact.php on line 78 (see same comment in code.
When I remove the line, it give a parse error to the next $tmpl->setVar() line.
My template code:
h2Contact the F2B.be staff/h2
tmpl_if name=post
tmpl_if name=error2
pThere are some errors/p
p
tmpl_if name=empty_van_naam
liName field is empty!
/tmpl_if
tmpl_if name=empty_van_email
liE-mail field is empty!
/tmpl_if
tmpl_if name=error_van_email
liWrong e-mail format!
/tmpl_if
tmpl_if name=empty_subject
liSubject field is empty!
/tmpl_if
tmpl_if name=empty_bericht
liMessage field is empty!
/tmpl_if
/p
pGo a href='javascripthistory.go-1'back/a and fix it./p
/tmpl_if
tmpl_if name=send
piMail has been send./i/p
pYour messagebr
blockquote!--tmpl_var name='mail_message'--/blockquote/p
/tmpl_if
tmpl_else
form method=POST action=tmpl_var name=__SELF__
center
pYour name brinput type=text name=van_naam size=50br
Your email brinput type=text name=van_email size=50br
Subjectbr input type=text name=onderwerp size=50br
Message brtextarea rows=10 cols=50 name=bericht/textareabr
input type=submit value=Send it to the staffinput type=reset value=Reset/form/p
/center
/tmpl_if
I never had this problem before in other scripts.
Thanks,