I am new to this website and I do not know how to solve this error I have when sending the form I leave the code, server errors and other information I hope you can help me.
Note: I am using Neubox as a host. Url: link
HTML:
<form name="formb" method="POST" action="sendform.php">
<input type="text" class="text" name="nombre" placeholder="Nombres"minlength="3" required>
<input type="text" class="text" name="nombre" placeholder="Nombres" minlength="3" required>
<select name="tipo" id="tipo" required>
<option value="0">- Tipo -</option>
<option value="1">Opcion1</option>
<option value="2">Opcion2</option>
</select>
<input type="email" class="text" name="correo" placeholder="E-Mail" required>
<textarea name="descripcion" id="descripcion" cols="30" rows="10" placeholder="Ingresa la descripcion" required></textarea>
<input type="submit" name="enviar" value="Enviar">
PHP:
<?php
if(isset($_POST['email'])) {
$email_to = "[email protected]";
$email_subject = "Formulario de comisiones(Preguntar)";
// Aquí se deberían validar los datos ingresados por el usuario
if(!isset($_POST['nombre']) ||
!isset($_POST['apellido']) ||
!isset($_POST['tipo']) ||
!isset($_POST['correo']) ||
!isset($_POST['descripcion'])) {
echo "<b>Ocurrió un error y el formulario no ha sido enviado. </b><br />";
echo "Por favor, vuelva atrás y verifique la información ingresada<br />";
die();
}
$email_message = "Detalles del formulario de contacto:\n\n";
$email_message .= "Nombre: " . $_POST['nombre'] . "\n";
$email_message .= "Apellido: " . $_POST['apellido'] . "\n";
$email_message .= "Tipo de Comision: " . $_POST['tipo'] . "\n";
$email_message .= "E-mail: " . $_POST['correo'] . "\n";
$email_message .= "Comentarios: " . $_POST['descripcion'] . "\n\n";
// Ahora se envía el e-mail usando la función mail() de PHP
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $email_subject, $email_message, $headers);
echo "¡El formulario se ha enviado con éxito!";
}
?>
Errors showing:
[Tue Oct 23 23: 05: 52.030594 2018] [: error] [pid 1967456] [client 181.199.83.79:40752] SoftException in Application.cpp: 261: File "/home/ocatartc/public_html/sendform.php "is writeable by group, referer: link
ADDED:
I wanted to know if an input file can be added to the form to upload images and how to make it work in the same sendform.php and upload it to the / uploads folder try this tutorial but it generates the same error 500 url: link
Update: I already fix the permissions on the sendform.php and it works, the problem is that the mail does not arrive at all.