HI I HAVE THIS SCRIPT THAT SEND AN EMAIL TO MOBILE PHONES AND WHEN IT SENDS THE MESSAGE GOS TO THE ECHO SECTION, I WANT TO ADD A BACK LINK THERE SO I HAVE NOT TO RELOAD THE PAGE TO SEND ANOTHER MESSAGE, AND EACH TIME I TRY TOMAKE THE LINK IT GIVES ME ERRORS
HERE IS THE CODE:
<?php */ ############################ # BE CAREFUL EDITING BELOW # ############################ // Process the form if it was submitted if (isset($_POST['do'])) { // Parse the data submitted from the form $number = trim($_POST['number']); $from = trim($_POST['from']); $message = trim($_POST['message']); // Check that the phone number is numeric if (!is_numeric($number)) { $error = "Ingresa solo numeros."; // Make sure the phone number doesn't start with 911 } elseif (eregi("^(911)(.*)$", $number)) { $error = "Ingresa un numero de celular valido."; // Check that the phone number is 10 digits } elseif (strlen($number) != "10") { $error = "Ingrese un numero de 10 caracteres incluyendo el numero de area, Ej: Cod Area: 3717 Numero: 543210."; // Check that the message is between 3 and 120 characters } elseif ((strlen($message) < "3") || (strlen($message) > "37")) { $error = "El mensaje no puede tener mas de 37 caracteres."; // Send the message } else { // Where are we sending it? $to = "[email protected], [email protected], [email protected]"; // Send the text message (via Teleflip's service) if (@mail($to, $message, "De: $from")) { // Give a success notice echo "Mensaje enviado AL NUMERO $number!"; echo "n"; echo "n"; echo "n"; exit; // Give an error that message can't be sent } else { $error = "Lo sentimos hubo un error enviando el mensaje, proba mas tarde."; } } } // Show any errors encountered if (isset($error)) { echo "" . $error . "n"; } ######## # FORM # ######## ?>
Numero
Ingrese el numero de destino con el codigo de area, Ej: 3717543210
De Tu nombre o nick. Mensaje Mensaje |