0
我收到我的電子郵件。我每天都會收到一些信息,無法嘗試聯繫我的潛在客戶。我測試這些頁面,他們似乎總是工作。如果我留下空白條目,我做測試時會出錯。我希望能夠解決這個問題,因爲我覺得我失去了潛在的銷售線索。我通過PHP表單電子郵件收到空白變量
電子郵件收到空白象下面這樣:
主題::
電子郵件::
Alt鍵電郵::
消息::
<?php
$where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));
mail("[email protected]","PhpFormGenerator - Contact from Website","Form data:
Subject:: " . $_POST['field_1'] . "
Email:: " . $_POST['field_2'] . "
Alt Email:: " . $_POST['field_3'] . "
Message:: " . $_POST['field_4'] .
");
include("confirm.html");
?>
<BR/><!-- begin form -->
<form method=post enctype=multipart/form-data action=processor.php onSubmit="return validatePage1();"><ul class=mainForm id="mainForm_1">
<li class="mainForm" id="fieldBox_1">
<label class="formFieldQuestion" style="font-size: medium">
Sudject: *</label><select class=auto-style13 name=field_1 id=field_1 style="width: 415px; height: 24px"><option value=''></option>
<option>Sales</option>
<option>Product Questions</option>
<option>Payment Quesitons</option>
<option>Shipping Questions</option>
<option>Support</option>
<option>Other (Not Listed)</option>
</select></li>
<li class="mainForm" id="fieldBox_2">
<label class="formFieldQuestion" style="font-size: medium">Email: *</label><input class=auto-style20 type=email name=field_2 id=field_2 size=20 value="" style="background-image:url('dolls/inflatable/order/imgs/email.png'); background-repeat: no-repeat; padding: 2px 2px 2px 25px; width: 385px; height: 24px;"><label class="formFieldQuestion" style="font-size: medium; width: 228px;">Alt. Email
or Re-Enter Email: *</label></li>
<li class="mainForm" id="fieldBox_3">
<input class=auto-style20 type=email name=field_3 id=field_3 size=20 value="" style="background-image:url('dolls/inflatable/order/imgs/email.png'); background-repeat: no-repeat; padding: 2px 2px 2px 25px; width: 385px; height: 24px;"></li>
<li class="mainForm" id="fieldBox_5">
</li>
<li class="mainForm" id="fieldBox_4">
<label class="formFieldQuestion" style="font-size: medium">
Message: *</label></li><textarea class=mainForm name=field_4 id=field_5 cols=20 style="width: 400px; height: 85px; background: #FFFFFF; color: #000000"></textarea>
<!-- end of this page -->
<!-- page validation -->
<SCRIPT type=text/javascript>
<!--
function validatePage1()
{
retVal = true;
if (validateField('field_1','fieldBox_1','text',1) == false)
retVal=false;
if (validateField('field_2','fieldBox_2','text',1) == false)
retVal=false;
if (validateField('field_3','fieldBox_3','text',1) == false)
retVal=false;
if(retVal == false)
{
alert('Please correct the errors. Fields marked with an asterisk (*)');
return false;
}
return retVal;
}
//-->
</SCRIPT>
<!-- end page validaton -->
<!-- next page buttons -->
<li class="mainForm">
<input id="saveForm" class="auto-style6" type="submit" value="Submit" style="height: 47px; color: #000000; background-color: #CCCCCC; font-size: medium; border: #000000; font-family: Arial, Helvetica, sans-serif; font-style: normal; font-weight: bold; font-size: 100%; font-variant: normal; line-height: normal; width: 277px;" />
</li>
</ul>
</form>
<!-- end of form -->
<!-- close the display stuff for this page -->
我新的這一點,並使用phpformgenerator創建此頁面。我真正關心的是獲取客戶的電子郵件地址。
任何幫助,將不勝感激。
感謝
您是否在發送此電子郵件之前驗證是否設置了$ _POST?你確定你的表單正確地發佈了變量嗎? (向我們顯示您的表單代碼) –
您應該在處理之前滿足條件,所以漫遊器不會觸發電子郵件。就像if(isset($ _ POST ['field_4'])){將你的頁面包裝在這裏} –
表單代碼已被添加到上面的帖子中。我是新來的PHP,我最擔心的是缺少客戶問題或可能的銷售 –