hi i have purchased theme but i think there is bug in contact form submission. theme use ajax to submit contact form.
link of contact form http://192.185.83.133/~lbrisas/TRY/ibrisas/contact.html
when you fill complete form and submit i will submit form using jquery ajax to contact.php file and here is code for the contact.php
code
spl_autoload_register(function($class_name){
$file_name = str_replace('\\', '/', $class_name);
$file_name = str_replace('_', '/', $file_name);
$file = dirname(__FILE__) . "/lib/$file_name.php";
if(is_file($file)) include $file;
});
use HybridLogic\Validation\Validator;
use HybridLogic\Validation\Rule;
$CONFIG = array(
/* Mail Options */
'mail_send_to' => 'vishalnthoriya@gmail.com',
'mail_contents' => 'mail-content.php',
'mail_failed_msg' => 'An unknown error has occured',
/* Notification Messages */
'form_errors_msg' => 'The following errors were encountered
- %s
',
'form_invalid_msg' => 'The form is invalid',
'form_success_msg' => 'Thank you
Your message has been sent, we\'ll get back to you shortly :)'
);
function createFormMessage( $formdata )
{
global $CONFIG;
ob_start();
extract($formdata);
include $CONFIG['mail_contents'];
return ob_get_clean();
}
function cleanInput($input) {
$search = array(
'@
', $validator->get_errors() ) ) );
}
echo json_encode($response);
?>
here is error
:Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /home/lbrisas/public_html/TRY/ibrisas/php/contact.php on line 3
thanks in advance
Answer
You need to change the way of calling function since anonymous functions are not supported in your PHP version:
function stack_2145($class_name)
{
$file_name = str_replace('\\', '/', $class_name);
$file_name = str_replace('_', '/', $file_name);
$file = dirname(__FILE__) . "/lib/$file_name.php";
if(is_file($file)) include $file;
}
spl_autoload_register("stack_2145");
No comments:
Post a Comment