fix form-comments
This commit is contained in:
parent
53972812e5
commit
3d6152a737
21
content/vendor/form-comments/commentsubmit.php
vendored
21
content/vendor/form-comments/commentsubmit.php
vendored
@ -23,8 +23,8 @@ if(empty($_POST['name']) ||
|
||||
!filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)
|
||||
)
|
||||
{
|
||||
// header( "Location: {$return_url}");
|
||||
header( "Location: ../{$return_url}");
|
||||
// header( "Location: ../{$return_url}"); # devel
|
||||
header( "Location: {$return_url}"); # prod
|
||||
} else {
|
||||
|
||||
$DATE_FORMAT = "Y-m-d H:i";
|
||||
@ -35,6 +35,9 @@ if(empty($_POST['name']) ||
|
||||
$comment = strip_tags(utf8_decode(htmlspecialchars($_POST['comment'])));
|
||||
$email_address = strip_tags(htmlspecialchars($_POST['email']));
|
||||
|
||||
// article
|
||||
$postID = str_replace('/','',$post_id);
|
||||
|
||||
//slug
|
||||
$nslug = seourl($name);
|
||||
$fslug = date("Ymd-H:i:s");
|
||||
@ -50,11 +53,11 @@ EOT;
|
||||
$email_body = <<<EOT
|
||||
Haz recibido un nuevo comentario del formulario de tu sitio web.\n\n
|
||||
Aqui estan los detalles:\n\n
|
||||
post_id: {$post_id}\n\n
|
||||
Author: {$name}\n\n
|
||||
Date: {$publish}\n\n
|
||||
Email: {$email_address}\n\n
|
||||
Slug: {$slug}\n\n
|
||||
post_id: {$postID}\n
|
||||
Author: {$name}\n
|
||||
Date: {$publish}\n
|
||||
Email: {$email_address}\n
|
||||
Slug: {$slug}\n
|
||||
Web: {$link}\n\n
|
||||
{$comment}
|
||||
EOT;
|
||||
@ -64,8 +67,8 @@ EOT;
|
||||
mail($to,$email_subject,$email_body,$headers);
|
||||
|
||||
// Rediret to current post
|
||||
// header( "Location: {$return_url}");
|
||||
header("Refresh: 10; URL=../{$return_url}");
|
||||
// header("Refresh: 10; URL=../{$return_url}"); # devel
|
||||
header("Refresh: 10; URL={$return_url}"); # prod
|
||||
printf('Hurra! %s su comentario se envió correctamente,
|
||||
volviendo a la web en 10 segundos...', $name);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user