Hi folks,
I've used the following 'Thank You' Code that is in the FAQ i.e.:
However, it throws up the following errors, the form is submitted but dont want to show the errors below to the users. Can anyone help please?
Kind regards,
Hanif
Parse error: syntax error, unexpected '>' in /home/dynecons/public_html/components/com_chronocontact/chronocontact.php(497) : eval()'d code on line 7
Warning: implode() [function.implode]: Bad arguments. in /home/dynecons/public_html/components/com_chronocontact/chronocontact.php(504) : eval()'d code on line 3
Warning: implode() [function.implode]: Bad arguments. in /home/dynecons/public_html/components/com_chronocontact/chronocontact.php(504) : eval()'d code on line 4
Warning: implode() [function.implode]: Bad arguments. in /home/dynecons/public_html/components/com_chronocontact/chronocontact.php(504) : eval()'d code on line 5
Warning: implode() [function.implode]: Bad arguments. in /home/dynecons/public_html/components/com_chronocontact/chronocontact.php(504) : eval()'d code on line 6
Warning: implode() [function.implode]: Bad arguments. in /home/dynecons/public_html/components/com_chronocontact/chronocontact.php(504) : eval()'d code on line 7
Warning: implode() [function.implode]: Bad arguments. in /home/dynecons/public_html/components/com_chronocontact/chronocontact.php(504) : eval()'d code on line 8
Post edited by: Hanif, at: 2008/04/12 11:50<br><br>Post edited by: admin, at: 2008/04/12 12:13
I've used the following 'Thank You' Code that is in the FAQ i.e.:
<?php
global $mainframe;
$custom_tag = '<meta http-equiv="refresh" content="5; url=http://www.mydomain.com" >';
$mainframe->addCustomHeadTag($custom_tag);
?>
<p>Thank You.</p>
<p>Further My Text.</p>
However, it throws up the following errors, the form is submitted but dont want to show the errors below to the users. Can anyone help please?
Kind regards,
Hanif
Parse error: syntax error, unexpected '>' in /home/dynecons/public_html/components/com_chronocontact/chronocontact.php(497) : eval()'d code on line 7
Warning: implode() [function.implode]: Bad arguments. in /home/dynecons/public_html/components/com_chronocontact/chronocontact.php(504) : eval()'d code on line 3
Warning: implode() [function.implode]: Bad arguments. in /home/dynecons/public_html/components/com_chronocontact/chronocontact.php(504) : eval()'d code on line 4
Warning: implode() [function.implode]: Bad arguments. in /home/dynecons/public_html/components/com_chronocontact/chronocontact.php(504) : eval()'d code on line 5
Warning: implode() [function.implode]: Bad arguments. in /home/dynecons/public_html/components/com_chronocontact/chronocontact.php(504) : eval()'d code on line 6
Warning: implode() [function.implode]: Bad arguments. in /home/dynecons/public_html/components/com_chronocontact/chronocontact.php(504) : eval()'d code on line 7
Warning: implode() [function.implode]: Bad arguments. in /home/dynecons/public_html/components/com_chronocontact/chronocontact.php(504) : eval()'d code on line 8
Post edited by: Hanif, at: 2008/04/12 11:50<br><br>Post edited by: admin, at: 2008/04/12 12:13
Hi Hanif,
Make your code as this only :
Cheers
Max
Make your code as this only :
<p>Thank You.</p>
<p>Further My Text.</p>
Cheers
Max
Hi Max,
Sorry mate I dont understand, I want the page to show a 'Thank You' Page for at least 5 seconds and then redirect them to the main home page, so this is On Submit code - after sending email. If the redirect is not present then it will just sit there.
Im using version of Joomla! 1.0.12, could this be the reason?
Thanks for the speedy reply by the way.
Kind regards,
Hanif
Sorry mate I dont understand, I want the page to show a 'Thank You' Page for at least 5 seconds and then redirect them to the main home page, so this is On Submit code - after sending email. If the redirect is not present then it will just sit there.
Im using version of Joomla! 1.0.12, could this be the reason?
Thanks for the speedy reply by the way.
Kind regards,
Hanif
Hi Hanif,
Does the form show the thanks message and redirects as expected ?
Cheers
Max
Does the form show the thanks message and redirects as expected ?
Cheers
Max
Hi Max,
The Thank you message is displayed after the user submits the form, and underneth that are the errors that I have shown above. After 5 seconds it then goes to the page that I set for the redirect. So it works to some extent but the error codes need to be hidden from being displayed🙂
Thank you again for the speedy reply.
Kind regards,
Hanif
The Thank you message is displayed after the user submits the form, and underneth that are the errors that I have shown above. After 5 seconds it then goes to the page that I set for the redirect. So it works to some extent but the error codes need to be hidden from being displayed🙂
Thank you again for the speedy reply.
Kind regards,
Hanif
Hi Hanif,
I tested it here on Joomla 1.0.14 and its just fine, this doesn't mean the reason is that you have J1.0.12, what i can read from your errors is that you have some other code at some place of the form which gives these errors, and not this piece of code, where do you have code else ?
Max
I tested it here on Joomla 1.0.14 and its just fine, this doesn't mean the reason is that you have J1.0.12, what i can read from your errors is that you have some other code at some place of the form which gives these errors, and not this piece of code, where do you have code else ?
Max
Hi Max,
Thanks for testing the code, I have the following present in the Form HTML(I origianlly got this from user Jamesls post on the forum and tweaked it slightly for my needs):
<style type="text/css">
<!--
legend
{
color:#000000;
background:#FFFFFF;
border: 1px solid #781351;
padding: 2px 6px;
}
fieldset
{
border: 1px solid #781351;
width: 90%;
background-color:#FFFFFF
}
label2
{
width: 16em;
text-align: right;
margin-right: 0.5em;
display: block;
}
label1
{
width: 8em;
float: left;
text-align: right;
margin-right: 0.5em;
display: block;
}
select {
width: 8em;
text-align: left;
}
input
{
color: #781351;
background: #fee3ad;
border: 1px solid #781351;
}
.submit input
{
color: #000;
background: white;
border: 2px outset #d7b9c9;
}
-->
</style>
</head>
<body>
<fieldset>
<legend>Dyne Consultancy Enquiry Response Form </legend>
</fieldset><br/>
<fieldset>
<legend><strong>Your Details</strong></legend>
<p><label1 for="name">Your Name:</label1><input type="text" name="name" size="40"></p>
<p><label1 for="email">E-mail:</label1><input name="email" type="text" size="40">
<p><label1 for="dayphone">Phone Number:</label1><input type="text" name="day_phone" size="20"> </p>
</p>
</fieldset>
<br/>
<fieldset>
<legend><strong>Your Enquiry is about:</strong></legend>
<div align="left">
<table border="0" width="90%" id="table4" align="left">
<tr>
<td width="150">
<p><input TYPE="checkbox" NAME="ff_nm_BusinessAnalysis[]" VALUE="info" id="ff_elem193">
<label id="ff_lbl193" for="ff_elem193">E-Business Analysis</label>
</p>
<p><input TYPE="checkbox" NAME="ff_nm_Projtmgt[]" VALUE="info" id="ff_elem194">
<label id="ff_lbl194" for="ff_elem194">Project Management</label>
</td>
<td width="164">
<p><input TYPE="checkbox" NAME="ff_nm_Websiteenhancement[]" VALUE="info" id="ff_elem195">
<label id="ff_lbl195" for="ff_elem195">Website Enhacement</label>
</p>
<p><input TYPE="checkbox" NAME="ff_nm_BusinessCoaching[]" VALUE="info" id="ff_elem196">
<label id="ff_lbl196" for="ff_elem196">Business Coaching</label>
</td>
<td width="304">
<p><input TYPE="checkbox" NAME="ff_nm_Campaign[]" VALUE="info" id="ff_elem197">
<label id="ff_lbl197" for="ff_elem197">Campaign Management</label>
</p>
<input TYPE="checkbox" NAME="ff_nm_Other[]1" VALUE="info" id="ff_elem199">
<label id="ff_lbl199" for="ff_elem199">Other Information or Questions: </label>
<p></td>
</tr>
</table>
</div>
<p></p>
<p><textarea COLS="50" NAME="other_info" id="ff_elem192" style="height: 63; width: 612" rows="4"></textarea>
</p>
</fieldset><br/>
<fieldset>
<legend><strong>The best way to contact you is</strong></legend>
<input type="checkbox" name="contact" value="phone"> By Telephone
<input type="checkbox" name="contact" value="email"> By Email </p>
</fieldset><br/>
<fieldset>
<legend><strong>Use the space below for any additional questions & comments:</strong></legend>
<p><textarea COLS="50" NAME="other_info0" id="ff_elem205" style="height: 63; width: 612" rows="4"></textarea>
</p>
</fieldset><br/>
<fieldset><legend><strong>AntiSpam</strong></legend>
<div align="center">{imageverification}</div>
</fieldset>
</p>
<p align="center">
<input type="submit" value="Send to Dyne Consultancy" name="Submit" style="font-weight: bold">
<input type="reset" value="Reset (cancel form)" name="reset" style="font-size: 8pt">
</p>
The AutoGenerate has the following:
<?php
global $database;
$_POST['ff_nm_BusinessAnalysis'] = implode(',', $_POST['ff_nm_BusinessAnalysis']);
$_POST['ff_nm_Projtmgt'] = implode(',', $_POST['ff_nm_Projtmgt']);
$_POST['ff_nm_Websiteenhancement'] = implode(',', $_POST['ff_nm_Websiteenhancement']);
$_POST['ff_nm_BusinessCoaching'] = implode(',', $_POST['ff_nm_BusinessCoaching']);
$_POST['ff_nm_Campaign'] = implode(',', $_POST['ff_nm_Campaign']);
$_POST['ff_nm_Other1'] = implode(',', $_POST['ff_nm_Other1']);
$database->setQuery( "INSERT INTO #__chronoforms_1 VALUES (
'' , '". date('Y-m-d')." - ".date("H:i:s")."', '".$_SERVER['REMOTE_ADDR']."' , '".mosGetParam($_POST,'name','')."' , '".mosGetParam($_POST,'email','')."' , '".mosGetParam($_POST,'day_phone','')."' , '".mosGetParam($_POST,'ff_nm_BusinessAnalysis','')."' , '".mosGetParam($_POST,'ff_nm_Projtmgt','')."' , '".mosGetParam($_POST,'ff_nm_Websiteenhancement','')."' , '".mosGetParam($_POST,'ff_nm_BusinessCoaching','')."' , '".mosGetParam($_POST,'ff_nm_Campaign','')."' , '".mosGetParam($_POST,'ff_nm_Other1','')."' , '".mosGetParam($_POST,'other_info','')."' , '".mosGetParam($_POST,'contact','')."' , '".mosGetParam($_POST,'other_info0','')."' , '".mosGetParam($_POST,'Submit','')."' , '".mosGetParam($_POST,'reset','')."');" );
if (!$database->query()) {
echo "<script> alert('".$database->getErrorMsg()."'); window.history.go(-1); </script>
";
}
?>
Further:
Anti Spam is enabled
And I have the following as required fields 'name,email, day_phone'
Kind regards,
Hanif
Thanks for testing the code, I have the following present in the Form HTML(I origianlly got this from user Jamesls post on the forum and tweaked it slightly for my needs):
<style type="text/css">
<!--
legend
{
color:#000000;
background:#FFFFFF;
border: 1px solid #781351;
padding: 2px 6px;
}
fieldset
{
border: 1px solid #781351;
width: 90%;
background-color:#FFFFFF
}
label2
{
width: 16em;
text-align: right;
margin-right: 0.5em;
display: block;
}
label1
{
width: 8em;
float: left;
text-align: right;
margin-right: 0.5em;
display: block;
}
select {
width: 8em;
text-align: left;
}
input
{
color: #781351;
background: #fee3ad;
border: 1px solid #781351;
}
.submit input
{
color: #000;
background: white;
border: 2px outset #d7b9c9;
}
-->
</style>
</head>
<body>
<fieldset>
<legend>Dyne Consultancy Enquiry Response Form </legend>
</fieldset><br/>
<fieldset>
<legend><strong>Your Details</strong></legend>
<p><label1 for="name">Your Name:</label1><input type="text" name="name" size="40"></p>
<p><label1 for="email">E-mail:</label1><input name="email" type="text" size="40">
<p><label1 for="dayphone">Phone Number:</label1><input type="text" name="day_phone" size="20"> </p>
</p>
</fieldset>
<br/>
<fieldset>
<legend><strong>Your Enquiry is about:</strong></legend>
<div align="left">
<table border="0" width="90%" id="table4" align="left">
<tr>
<td width="150">
<p><input TYPE="checkbox" NAME="ff_nm_BusinessAnalysis[]" VALUE="info" id="ff_elem193">
<label id="ff_lbl193" for="ff_elem193">E-Business Analysis</label>
</p>
<p><input TYPE="checkbox" NAME="ff_nm_Projtmgt[]" VALUE="info" id="ff_elem194">
<label id="ff_lbl194" for="ff_elem194">Project Management</label>
</td>
<td width="164">
<p><input TYPE="checkbox" NAME="ff_nm_Websiteenhancement[]" VALUE="info" id="ff_elem195">
<label id="ff_lbl195" for="ff_elem195">Website Enhacement</label>
</p>
<p><input TYPE="checkbox" NAME="ff_nm_BusinessCoaching[]" VALUE="info" id="ff_elem196">
<label id="ff_lbl196" for="ff_elem196">Business Coaching</label>
</td>
<td width="304">
<p><input TYPE="checkbox" NAME="ff_nm_Campaign[]" VALUE="info" id="ff_elem197">
<label id="ff_lbl197" for="ff_elem197">Campaign Management</label>
</p>
<input TYPE="checkbox" NAME="ff_nm_Other[]1" VALUE="info" id="ff_elem199">
<label id="ff_lbl199" for="ff_elem199">Other Information or Questions: </label>
<p></td>
</tr>
</table>
</div>
<p></p>
<p><textarea COLS="50" NAME="other_info" id="ff_elem192" style="height: 63; width: 612" rows="4"></textarea>
</p>
</fieldset><br/>
<fieldset>
<legend><strong>The best way to contact you is</strong></legend>
<input type="checkbox" name="contact" value="phone"> By Telephone
<input type="checkbox" name="contact" value="email"> By Email </p>
</fieldset><br/>
<fieldset>
<legend><strong>Use the space below for any additional questions & comments:</strong></legend>
<p><textarea COLS="50" NAME="other_info0" id="ff_elem205" style="height: 63; width: 612" rows="4"></textarea>
</p>
</fieldset><br/>
<fieldset><legend><strong>AntiSpam</strong></legend>
<div align="center">{imageverification}</div>
</fieldset>
</p>
<p align="center">
<input type="submit" value="Send to Dyne Consultancy" name="Submit" style="font-weight: bold">
<input type="reset" value="Reset (cancel form)" name="reset" style="font-size: 8pt">
</p>
The AutoGenerate has the following:
<?php
global $database;
$_POST['ff_nm_BusinessAnalysis'] = implode(',', $_POST['ff_nm_BusinessAnalysis']);
$_POST['ff_nm_Projtmgt'] = implode(',', $_POST['ff_nm_Projtmgt']);
$_POST['ff_nm_Websiteenhancement'] = implode(',', $_POST['ff_nm_Websiteenhancement']);
$_POST['ff_nm_BusinessCoaching'] = implode(',', $_POST['ff_nm_BusinessCoaching']);
$_POST['ff_nm_Campaign'] = implode(',', $_POST['ff_nm_Campaign']);
$_POST['ff_nm_Other1'] = implode(',', $_POST['ff_nm_Other1']);
$database->setQuery( "INSERT INTO #__chronoforms_1 VALUES (
'' , '". date('Y-m-d')." - ".date("H:i:s")."', '".$_SERVER['REMOTE_ADDR']."' , '".mosGetParam($_POST,'name','')."' , '".mosGetParam($_POST,'email','')."' , '".mosGetParam($_POST,'day_phone','')."' , '".mosGetParam($_POST,'ff_nm_BusinessAnalysis','')."' , '".mosGetParam($_POST,'ff_nm_Projtmgt','')."' , '".mosGetParam($_POST,'ff_nm_Websiteenhancement','')."' , '".mosGetParam($_POST,'ff_nm_BusinessCoaching','')."' , '".mosGetParam($_POST,'ff_nm_Campaign','')."' , '".mosGetParam($_POST,'ff_nm_Other1','')."' , '".mosGetParam($_POST,'other_info','')."' , '".mosGetParam($_POST,'contact','')."' , '".mosGetParam($_POST,'other_info0','')."' , '".mosGetParam($_POST,'Submit','')."' , '".mosGetParam($_POST,'reset','')."');" );
if (!$database->query()) {
echo "<script> alert('".$database->getErrorMsg()."'); window.history.go(-1); </script>
";
}
?>
Further:
Anti Spam is enabled
And I have the following as required fields 'name,email, day_phone'
Kind regards,
Hanif
Hi Hanif,
Which Chronoforms version you have installed ?
Which Chronoforms version you have installed ?
Hi Hanif,
Is the code you have on the "onsubmit" after email box which gives the first syntax error, then the Autogenerated code which gives the warnings, please make each implode line above like this :
Cheers
Max
Is the code you have on the "onsubmit" after email box which gives the first syntax error, then the Autogenerated code which gives the warnings, please make each implode line above like this :
if(is_array($_POST['ff_nm_BusinessAnalysis']))
$_POST['ff_nm_BusinessAnalysis'] = implode(',', $_POST['ff_nm_BusinessAnalysis']);
Cheers
Max
Hi Max,
Used the code that you supplied and reduced the number of errors from 8 to only a single one, it still displays the following error msg:
Used the code that you supplied and reduced the number of errors from 8 to only a single one, it still displays the following error msg:
Parse error: syntax error, unexpected '=', expecting ']' in /home/dynecons/public_html/components/com_chronocontact/chronocontact.php(504) : eval()'d code on line 6
The Autogenerate has the following now present:<?php
global $database;
if(is_array($_POST['ff_nm_BusinessAnalysis']))
$_POST['ff_nm_BusinessAnalysis'] = implode(',', $_POST['ff_nm_BusinessAnalysis']);
if(is_array($_POST['ff_nm_Projtmgt']))
$_POST['ff_nm_Projtmgt' = implode(',', $_POST['ff_nm_Projtmgt']);
if(is_array($_POST['ff_nm_Websiteenhancement']))
$_POST['ff_nm_Websiteenhancement'] = implode(',', $_POST['ff_nm_Websiteenhancement']);
if(is_array($_POST['ff_nm_BusinessCoaching']))
$_POST['ff_nm_BusinessCoaching'] = implode(',', $_POST['ff_nm_BusinessCoaching']);
if(is_array($_POST['ff_nm_Campaign']))
$_POST['ff_nm_Campaign'] = implode(',', $_POST['ff_nm_Campaign']);
if(is_array($_POST['ff_nm_Other1']))
$_POST['ff_nm_Other1'] = implode(',', $_POST['ff_nm_Other1']);
$database->setQuery( "INSERT INTO #__chronoforms_1 VALUES (
'' , '". date('Y-m-d')." - ".date("H:i:«»s"«»)."', '".$_SERVER['REMOTE_ADDR']."' , '".mosGetParam($_POST,'name','')."' , '".mosGetParam($_POST,'email','')."' , '".mosGetParam($_POST,'day_phone','')."' , '".mosGetParam($_POST,'ff_nm_BusinessAnalysis','')."' , '".mosGetParam($_POST,'ff_nm_Projtmgt','')."' , '".mosGetParam($_POST,'ff_nm_Websiteenhancement','')."' , '".mosGetParam($_POST,'ff_nm_BusinessCoaching','')."' , '".mosGetParam($_POST,'ff_nm_Campaign','')."' , '".mosGetParam($_POST,'ff_nm_Other1','')."' , '".mosGetParam($_POST,'contact','')."' ,
'".mosGetParam($_POST,'Submit','')."' , '".mosGetParam($_POST,'reset','')."');" );
if (!$database->query()) {
echo "<script> alert('".$database->getErrorMsg()."'); window.history.go(-1); </script>
";
}
?>Once again, thanks for your help, nearly there🙂<br><br>Post edited by: GreyHead, at: 2008/04/14 10:31
This topic is locked and no more replies can be posted.
