I was asked to upload files for a website I did not create. I have fixed most of the issues I found uploading the files but the SUBMIT button on the contact page and the RESERVATION button on the Reservation page are not working.We are using PHP so I was trying to change the script on HTML, when it asked for the correct route to the script I don’t know how to do it because the files of the processes where done in coldfusion which I sadly know nothing about. File names are send_message_process.cfm and send_reservation_request_process.cfm.
I tried to translate them to php and it gave me this but it just doesn’t seem right. Help please!!
``your text``<?php
`your text`// Recibe los datos del formulario
`your text`$names = $_POST['names'];
`your text`$email = $_POST['email'];
`$phone = $_POST['phone'];
$message = $_POST['message'];
`your text`// Aquí puedes agregar la lógica para procesar los datos del formulario, como enviar un correo electrónico o guardarlos en una base de datos.
`your text`// Por ejemplo, para enviar un correo electrónico de confirmación:
`your text`$to = "[email protected]"; // Cambia esto por tu dirección de correo electrónico
`your text`$subject = "Nuevo mensaje de contacto";
`your text`$body = "Nombre: $namesnCorreo electrónico: $emailnTeléfono: $phonenMensaje:`your text`n$message";
`your text`$headers = "From: $email";
`your text`// Envía el correo electrónico
`your text`if (mail($to, $subject, $body, $headers)) {
`your text`echo "¡Gracias por tu mensaje! Te responderemos pronto.";
`your text`} else {
`your text`echo "Hubo un error al enviar el mensaje. Por favor, inténtalo de nuevo más `your text`tarde.";
`your text`}
`your text`?>`
Anahi Cespedes is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1