我的前任老板要我在他的网站上要求报价单的地方添加一个下拉菜单。我没有PHP的经验,而且我不是此网站的网站管理员。但是他给了我登录信息给他的cpanel,以便我可以更改文件。我需要做的就是在表单中添加一个下拉菜单。
查看PHP,这看起来非常简单。这就是PHP的样子。我只添加了两行代码,现在所有者无法从客户那里收到此表格?
<?php
//$to = "techlysesolutions@gmail.com";
// $to = "info@gilbertmovingandstorage.com";
$to = "gilbertmovingandstorage@gmail.com";
$fname = $_POST['element_1_1'];
$lname = $_POST['element_1_2'];
$email = $_POST['element_5'];
$phone = $_POST['element_6_1'];
$message = $_POST['element_7'];
// pickup address
$pick_add1 = $_POST['element_2_1'];
$pick_add2 = $_POST['element_2_2'];
$pick_add3 = $_POST['element_2_3'];
$pick_add4 = $_POST['element_2_4'];
$pick_add5 = $_POST['element_2_5'];
$pick_add6 = $_POST['element_2_6'];
// Drop Off Address address
$drop_add1 = $_POST['element_3_1'];
$drop_add2 = $_POST['element_3_2'];
$drop_add3 = $_POST['element_3_3'];
$drop_add4 = $_POST['element_3_4'];
$drop_add5 = $_POST['element_3_5'];
$drop_add6 = $_POST['element_3_6'];
//Date
$month = $_POST['element_4_1'];
$day = $_POST['element_4_2'];
$year = $_POST['element_4_3'];
$ref = $_POST['element_4_4']; // I ADDED THIS LINE------------------------
$date = $month.'/'.$day.'/'.$year;
$subject = "Contact Inquiry";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
$headers .= "From:".$email;
//$headers .= "BCC: admin@example.com";
echo $txt = '<table width="300">
<tr><td></td><td>'.$fname.' '.$lname.'</td></tr>
<tr><td></td><td>'.$email.'</td></tr>
<tr><td></td><td>'.$phone.'</td></tr>
<tr><td style="font-weight:bold"></td></tr>
<tr><td></td><td>'.$pick_add1.'</td></tr>
<tr><td></td><td>'.$pick_add2.'</td></tr>
<tr><td></td><td>'.$pick_add3.'</td></tr>
<tr><td></td><td>'.$pick_add4.'</td></tr>
<tr><td></td><td>'.$pick_add5.'</td></tr>
<tr><td></td><td>'.$pick_add6.'</td></tr>
<tr><td style="font-weight:bold"></td></tr>
<tr><td></td><td>'.$drop_add1.'</td></tr>
<tr><td></td><td>'.$drop_add2.'</td></tr>
<tr><td></td><td>'.$drop_add3.'</td></tr>
<tr><td></td><td>'.$drop_add4.'</td></tr>
<tr><td></td><td>'.$drop_add5.'</td></tr>
<tr><td></td><td>'.$drop_add6.'</td></tr>
<tr><td></td><td>'.$date.'</td></tr>
<tr><td>Moving Date</td><td>'.$ref.'</td></tr> // I ADDED THIS LINE----------
<tr><td></td><td>'.$message.'</td></tr>
</table>';
mail($to,$subject,$txt,$headers);
如您所见,我仅添加了两行。但是我此后删除了这些行,因此就好像我从未触摸过文件一样。但是它仍然不起作用。我不知道该怎么办。
这是控制台错误:
Mixed Content: The page at 'https://gilbertmovingandstorage.com/thank-you.html' was loaded over HTTPS, but requested an insecure stylesheet 'http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700,800&subset=latin,latin-ext'. This request has been blocked; the content must be served over HTTPS.
thank-you.html:16 GET https://gilbertmovingandstorage.com/css/template-style.css net::ERR_ABORTED 404 (Not Found)
thank-you.html:123 Mixed Content: The page at 'https://gilbertmovingandstorage.com/thank-you.html' was loaded over HTTPS, but requested an insecure image 'http://www.homeadvisor.com/images/sp-badges/soap-solid-border.png?sp=78481642&key=21e548420c6170d53f4c698d79bf730c'. This content should also be served over HTTPS.
thank-you.html:62 GET https://gilbertmovingandstorage.com/img/quote.jpg 404 (Not Found)
HTML代码段用于引用形式。如果您想访问实际的网站,请访问www.gilbertmovingandstorage.com。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>
Request a Quote | Arizona Moving Services
</title>
<link rel="stylesheet" type="text/css" href="view.css" media="all">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script type="text/javascript" src="view.js"></script>
<script type="text/javascript" src="calendar.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Gilbert Moving & Storage offers Residential and Business moving services. Based out of Gilbert AZ, we can service moves ranging from within the Phoenix valley to nationwide.">
<meta name="keywords" content="Gilbert Moving, Moving Services, AZ Moving Services, Residential Moving, Business Moving">
<!-- <link rel="stylesheet" type="text/css" href="reset.css"> -->
<link rel="stylesheet" href="css/components.css">
<link rel="stylesheet" href="css/icons.css">
<link rel="stylesheet" href="css/responsee.css">
<link rel="stylesheet" href="owl-carousel/owl.carousel.css">
<link rel="stylesheet" href="owl-carousel/owl.theme.css">
<!-- CUSTOM STYLE -->
<link rel="stylesheet" href="css/template-style.css">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700,800&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
<script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="js/jquery-ui.min.js"></script>
</head>
<body id="main_body" class="size-1140">
<!-- TOP NAV WITH LOGO -->
<header>
<nav>
<div class="line">
<div class="s-12 l-2">
<a href="/index.html">
<img class="s-5 l-12 center" src="img/GilbertMoving_3e.png">
</a>
</div>
<div class="top-nav s-12 l-10 right">
<p class="nav-text">
Menu
</p>
<div class="phone">
<a href="tel:480-825-8648">
(480) 825-8648
</a>
</div>
<ul class="right">
<li>
<a href="/index.html">
Home
</a>
</li>
<li>
<a href="/gallery.html">
Gallery
</a>
</li>
<li>
<a>
Getting Started
</a>
<ul>
<li>
<a href="/request-a-quote.html">
Request a Quote
</a>
</li>
<!-- <li>
<a href="deposit.html" target="_blank">
Make a Deposit
</a>
</li>
<li>
<a>
Contact us Diectly
</a>
</li> -->
</ul>
</li>
</ul>
</div>
</div>
</nav>
</header>
<!-- CAROUSEL -->
<section>
<div id="carousel">
<div id="owl-demo" class="owl-carousel owl-theme">
<div class="item">
<img src="img/lakehouse.jpg" alt=¡°Arizona Moving Price Quote¡±>
</div>
</div>
</div>
<img id="top" src="img/top.png" alt="">
<div id="form_container">
<form id="contact-form" class="appnitro" method="post" action="">
<div class="form_description">
<h2>
Request a Quote
</h2>
<p>
Provide the information below and we will reach out to provide a price quote for your move.
</p>
</div>
<ul>
<li id="li_1">
<label class="description" for="element_1">
Name
</label>
<span>
<input id="element_1_1" name= "element_1_1" class="element text" maxlength="255" size="8" value=""/>
<label>
First
</label>
</span>
<span>
<input id="element_1_2" name= "element_1_2" class="element text" maxlength="255" size="14" value=""/>
<label>
Last
</label>
</span>
</li>
<li id="li_6">
<label class="description" for="element_6">
Phone
</label>
<span>
<input id="element_6_1" name="element_6_1" class="element text" placeholder="* xxx xxx xxxx" value="" type="text">
<label for="element_6_1">
(###) ### ####
</label>
</span>
</li>
<li id="li_5">
<label class="description" for="element_5">
Email
</label>
<div>
<input id="element_5" name="element_5" class="element text medium" type="text" maxlength="255" value="" />
</div>
</li>
<li id="li_2">
<label class="description" for="element_2">
Pick Up Address
</label>
<div>
<input id="element_2_1" name="element_2_1" class="element text large" value="" type="text">
<label for="element_2_1">
Street Address
</label>
</div>
<div>
<input id="element_2_2" name="element_2_2" class="element text large" value="" type="text">
<label for="element_2_2">
Address Line 2
</label>
</div>
<div class="left">
<input id="element_2_3" name="element_2_3" class="element text medium" value="" type="text">
<label for="element_2_3">
City
</label>
</div>
<div class="right">
<input id="element_2_4" name="element_2_4" class="element text medium" value="Arizona" type="text">
<label for="element_2_4">
State / Province / Region
</label>
</div>
<div class="left">
<input id="element_2_5" name="element_2_5" class="element text medium" maxlength="15" value="" type="text">
<label for="element_2_5">
Postal / Zip Code
</label>
</div>
<div class="right">
<select class="element select medium" id="element_2_6" name="element_2_6">
<option value="United States" selected="selected">
United States
</option>
<option value="Canada">
Canada
</option>
<option value="Mexico">
Mexico
</option>
</select>
<label for="element_2_6">
Country
</label>
</div>
</li>
<li id="li_3">
<label class="description" for="element_3">
Drop Off Address
</label>
<div>
<input id="element_3_1" name="element_3_1" class="element text large" value="" type="text">
<label for="element_3_1">
Street Address
</label>
</div>
<div>
<input id="element_3_2" name="element_3_2" class="element text large" value="" type="text">
<label for="element_3_2">
Address Line 2
</label>
</div>
<div class="left">
<input id="element_3_3" name="element_3_3" class="element text medium" value="" type="text">
<label for="element_3_3">
City
</label>
</div>
<div class="right">
<input id="element_3_4" name="element_3_4" class="element text medium" value="Arizona" type="text">
<label for="element_3_4">
State / Province / Region
</label>
</div>
<div class="left">
<input id="element_3_5" name="element_3_5" class="element text medium" maxlength="15" value="" type="text">
<label for="element_3_5">
Postal / Zip Code
</label>
</div>
<div class="right">
<select class="element select medium" id="element_3_6" name="element_3_6">
<option value="United States" selected="selected">
United States
</option>
<option value="Canada">
Canada
</option>
<option value="Mexico">
Mexico
</option>
</select>
<label for="element_3_6">
Country
</label>
</div>
</li>
<li id="li_4">
<label class="description" for="element_4">
Moving Date
</label>
<span>
<input id="element_4_1" name="element_4_1" class="element text" size="2" maxlength="2" value="" type="text">
/
<label for="element_4_1">
MM
</label>
</span>
<span>
<input id="element_4_2" name="element_4_2" class="element text" size="2" maxlength="2" value="" type="text">
/
<label for="element_4_2">
DD
</label>
</span>
<span>
<input id="element_4_3" name="element_4_3" class="element text" size="4" maxlength="4" value="" type="text">
<label for="element_4_3">
YYYY
</label>
</span>
<span id="calendar_4">
<img id="cal_img_4" class="datepicker" src="img/calendar.gif" alt="Pick a date.">
</span>
<script type="text/javascript">
Calendar.setup({
inputField: "element_4_3",
baseField: "element_4",
displayArea: "calendar_4",
button: "cal_img_4",
ifFormat: "%B %e, %Y",
onSelect: selectDate
});
</script>
<div class="dropdown">
<label for="element_4_4" class="description">Referred by*</label>
<select name="element_4_4" id="dropdown">
<option value="Customer Referrel">Customer Referrel</option>
<option value="Home Advisor">Home Advisor</option>
<option value="Google">Google</option>
<option value="Facebook">Facebook</option>
<option value="Yelp">Yelp</option>
<option value="Postcard">Postcard</option>
<option value="Realtors">Realtors</option>
<option value="Reapeat Customer">Reapeat Customer</option>
</select>
</div>
</li>
<li id="li_7">
<label class="description" for="element_7">
Special Considerations / Comments
</label>
<div>
<textarea id="element_7" name="element_7" class="element textarea medium"></textarea>
</div>
</li>
<li class="buttons">
<input type="hidden" name="form_id" value="4454" />
<input id="saveForm" class="button_text submit" type="submit" name="submit" value="Submit" />
</li>
</ul>
</form>
</div>
<img id="bottom" src="/img/bottom.png" alt="">
<script>
document.getElementById('element_6_1').addEventListener('input', function(e) {
var x = e.target.value.replace(/\D/g, '').match(/(\d{0,3})(\d{0,3})(\d{0,4})/);
e.target.value = !x[2] ? x[1] : '(' + x[1] + ') ' + x[2] + (x[3] ? '-' + x[3] : '');
});
$(document).ready(function() {
$('#contact-form').submit(function() {
$('#contact-form .error-msg').removeClass('error-msg');
form = true;
elm = $(this);
fname = $('#element_1_1').val();
lname = $('#element_1_2').val();
phone = $('#element_6_1').val();
email = $('#element_5').val();
message = $('#element_7').val();
email_regex = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
if (email == '') {
$('#element_5').addClass('error-msg');
form = false;
} else if (email_regex.test(email) == false) {
$('#element_5').addClass('error-msg');
form = false;
}
if (phone.length != 14) {
$('#element_6_1').addClass('error-msg');
form = false;
}
if (fname == '') {
$('#element_1_1').addClass('error-msg');
form = false;
}
if (lname == '') {
$('#element_1_2').addClass('error-msg');
form = false;
}
if (message == '') {
$('#element_7').addClass('error-msg');
form = false;
}
if (form) {
$.ajax({
url: 'email.php',
type: 'post',
data: $('#contact-form').serialize(),
success: function(res) {
$('#contact-form')[0].reset();
window.location = '/thank-you.html';
}
});
}
return false;
});
});
</script>
</section>
<!-- FOOTER -->
<footer>
<div class="line">
<div class="s-12 l-6">
<p>
<span style="font-size: 10px;">
Copyright 2018, Gilbert Moving and Storage
</span>
</p>
</div>
<div class="s-12 l-6">
</div>
</div>
<!-- Google Analytics -->
<script>
(function(i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function() {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m)
})(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-90548139-1', 'auto');
ga('send', 'pageview');
</script>
</footer>
<script type="text/javascript" src="js/responsee.js"></script>
<script type="text/javascript" src="owl-carousel/owl.carousel.js"></script>
<script type="text/javascript">
jQuery(document).ready(function($) {
$("#owl-demo").owlCarousel({
navigation: true,
slideSpeed: 300,
paginationSpeed: 400,
autoPlay: true,
singleItem: true
});
$("#owl-demo2").owlCarousel({
slideSpeed: 300,
autoPlay: true,
navigation: true,
pagination: true,
singleItem: true
});
});
</script>
</body>
</html>
错误日志:
[2019年7月9日星期二17:28:54] [错误] [客户端174.26.196.199]文件不存在:/home/me958625/public_html/gilbertmovingandstorage.com/404.shtml,引荐网址:https://gilbertmovingandstorage.com/thank-you.html [2019年7月9日星期二17:28:54] [错误] [客户端174.26.196.199]文件不存在:/home/me958625/public_html/gilbertmovingandstorage.com/img/quote.jpg,引荐来源:https://gilbertmovingandstorage.com/thank-you.html [2019年7月9日星期二17:28:54] [错误] [客户端174.26.196.199]文件不存在:/home/me958625/public_html/gilbertmovingandstorage.com/404.shtml,引荐来源:https://gilbertmovingandstorage.com/thank-you.html [2019年7月9日星期二17:28:54] [错误] [客户端174.26.196.199]文件不存在:/home/me958625/public_html/gilbertmovingandstorage.com/css/template-style.css,引荐来源:{{3} } [2019年7月9日星期二17:28:41] [错误] [客户端174.26.196.199]文件不存在:/home/me958625/public_html/gilbertmovingandstorage.com/404.shtml,引荐来源:https://gilbertmovingandstorage.com/thank-you.html [2019年7月9日星期二17:28:41] [错误] [客户端174.26.196.199]文件不存在:/home/me958625/public_html/gilbertmovingandstorage.com/images,引荐来源:https://gilbertmovingandstorage.com/view.css