0
我之前在另一個登陸頁面上使用了這個php代碼,並且無法更好地工作,但是現在我在託管在子域上的登錄頁面上使用它,並且它不工作。這兩個檔案的index.php和thank-you-page.html都存儲在同一個文件夾中。爲什麼這個PHP代碼重定向的形式不工作?
繼承人的代碼。
<div id="forma" class="col-2">
<?php
$action=$_REQUEST['action'];
if ($action=="")
{
?>
<form action="" method="POST" enctype="multipart/form-data">
<input type="hidden" name="action" value="submit">
<p>Nombre</p> <input type="text" name="name"/>
<p>Apellidos</p> <input type="text" name="surname"/>
<p>Email</p> <input type="text" name="email">
<p>Teléfono</p> <input type="text" name="phone" maxlength="12"/>
<input type="submit" value="Enviar" name="submit"/><input type="reset" value="Limpiar">
<?php
include "include/thank-you-page.html";
?>
</form>
<?php
}
else if($_POST['email'] == '' or !preg_match("/^[a-zA-Z0-9_\.\-][email protected][a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$/",$_POST['email'])){
echo "Favor de ingresar un correo válido <a href=\"\">en la forma</a>";}
else
{
$name=utf8_decode($_POST['name']);
$surname=utf8_decode($_POST['surname']);
$email=$_POST['email'];
$phone=$_POST['phone'];
$message="
APC Back-UPS Landing page:
Nombre: $name
Apellidos: $surname
e-mail: $email
telefono: $phone";
if(($name=="")||($email=="")||($phone==""))
{
echo "Favor de llenar los campos requeridos <a href=\"\">en la forma</a>";
}
else
{
$from="From: $name<$email>\r\nReturn-path: $email";
$subject = "Landing page Back-UPS";
mail("[email protected]", $subject, $message, $from);
header('Location: http://www.securepowersolutions.com.mx/backups/thank-you-page.html');
}
}
?>
有關爲什麼它不回答的任何想法?
歡迎來到Stack Overflow!你能詳細說明你的代碼「不起作用」嗎?你在期待什麼,究竟發生了什麼?如果發生異常或錯誤,請發佈發生的行和詳細信息。請[編輯]這些細節或我們可能無法提供幫助。 –