HTML показывает после отправки формы и нигде не найти в PHP-скрипте - PullRequest
0 голосов
/ 31 марта 2010

После отправки этой формы на мой сайт. Это отправляет меня на страницу с надписью.

"Использовать Назад - заполните все поля Использовать обратно! ! «

Но этот html нигде не присутствует в почтовом скрипте. Откуда это может исходить? Я начал использовать эту контактную форму (http://www.ibdhost.com/contact/), затем немного изменил ее.

Вот почтовый скрипт.

<?php session_start(); ?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sendemail Script</title>
</head>
<body>

<!-- Reminder: Add the link for the 'next page' (at the bottom) -->
<!-- Reminder: Change 'YourEmail' to Your real email -->
<?php
//the 3 variables below were changed to use the SERVER variable
$ip = $_SERVER['REMOTE_ADDR'];
$httpref = $_SERVER['HTTP_REFERER'];
$httpagent = $_SERVER['HTTP_USER_AGENT'];

$visitorf = $_POST['visitorf'];
$visitorl = $_POST['visitorl'];
$visitormail = $_POST['visitormail'];
$visitorphone = $_POST['visitorphone'];
//$notes = $_POST['notes'];
//$attn = $_POST['attn'];
$lookup = array(
    'The Election Report' => 'http://www.mydowmain.net/',
    '5 Resons' => 'http://www.mydomain.net/',
 'Report 3' => 'http://someotherurl3.com/',
 'Report 4' => 'http://someotherurl4.com/',
 'Report 5' => 'http://someotherurl5.com/',
    // et cetera for your other values
);

$attn = trim($_POST['attn']);
$url = $lookup[$attn];
//echo 'attn: ' . $attn . ', url:' . $url; die;

//additional headers 
$headers = 'From: US <info@mailinator.net>' . "\r\n";
//$headers .= 'BCC: kelbizzle@mailinator.com' . "\r\n";

$todayis = date("l, F j, Y, g:i a") ;
$subject = "your lead has downloaded a report.";
$subjectdp = "Someone has downloaded a report!";
$notes = stripcslashes($notes);
$message = "Dear PAl Affiliate,\n\nA prospective lead of yours has downloaded a report from our Website.\nAny contact information they have left and a link to the report they downloaded\ncan be found below. This is the perfect opportunity for you to open up a line of\ncommunication with the prospect and find out their intrests! If you have any questions\nabout this email please feel free to email us at info@mailinaot.net\n\n\nFrom: $visitorf $visitorl ($visitormail)\nTelephone Number: $visitorphone \nReport Downloaded:$url\n \n\nBest regards,\nThe Crew";
//$message = "$todayis [EST] \nAttention:  \nMessage: $notes \nFrom: $visitorf $visitorl ($visitormail) \nTelephone Number: //$visitorphone \nReport Downloaded:$url\nAdditional Info : IP = $ip \nBrowser Info: $httpagent \nReferral : $httpref\n";
$messagedp = "A Visitor has just downloaded a report. You can find their contact information below.\n
\n
***********************************************************************\n
From: $visitorf $visitorl\n
Email: $visitormail\n
Telephone Number: $visitorphone \n
Report Downloaded:$url\n
\n
\n
Best regards,\n
The Crew\n";
$messagelead = "Dear, $visitorf\n
\n
\n
We appreciate your interest. Below you will find the URL to download the report you requested.\n
Things are always changing in costa rica , so check back often. Also, check us out on Facebook & Twitter \n
for daily updates. If there is anything we can do at anytime to enhance your experience, please do\n
not hesitate to  contact us.\n
\n
To download your report simply click on the link below. (You must have Adobe Reader or an alternative PDF reader installed)\n
\n
*** Download Link ***\n
$url\n";
//check if the function even exists
if(function_exists("mail"))
{
 //send the email
 mail($_SESSION['email'], $subject, $message, $headers) or die("could not send email");
} else {
     die("mail function not enabled");
    } 
     //send the email to us
     mail('info@mailinator.com', $subjectdp, $messagedp);
     //send the email to the lead
     mail($visitormail, 'Thanks for downloading the report!', $messagelead, $headers);

    header( "Location: http://www.mydomain.com/thanks_report.php" );
    ?>

    </body>
    </html>

1 Ответ

1 голос
/ 31 марта 2010

Согласно странице, на которую вы ссылались (интересный оттенок розового цвета, я мог бы добавить;)), у вас есть sendeail.php (хотя я предполагаю, что это sendemail.php), и в нем он содержит код:

if(empty($visitor) || empty($visitormail) || empty($notes )) {
   echo "<h2>Use Back - fill in all fields</h2>\n";
   die ("Use back! ! "); 
}

Вы подразумеваете, что вы изменили приведенный выше код, чтобы сделать то, что вы хотите, но изменили ли вы расположение формы POST на странице раньше? например В примере, указанном в вашей ссылке, указывается, что если вы не обновили эту ссылку, чтобы она указала на вашу новую версию, эта ошибка будет учтена. (Примечание: вам, вероятно, следует убедиться, что вы обновили страницу с заполненной пользователем формой).

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...