php - 在此页面中悬停不起作用,我不知道为什么,即使我已经给了它,页脚也没有占用 100% 的宽度

标签 php html css

是我的编码不正确还是悬停和页脚有什么问题。我需要知道 php 邮件程序是否正确,或者我是否有错误我无法找到错误,因为邮件功能在本地服务器上不起作用。

<?php
if(isset($_POST["submit"])){

if($_POST["name"]==""||$_POST["email"]==""||$_POST["phone"]==""||$_POST["msg"]==""){
echo "Fill All Fields..";
}
else
{
$email=$_POST['email'];
$email= filter_var($email, FILTER_VALIDATE_EMAIL);
if (!$email){
echo "Invalid Sender's Email";
}
else{
$subject = $_POST['sub'];
$message = $_POST['msg'];
$headers = 'From:'. $email2 . "\r\n"; 
$headers .= 'Cc:'. $email2 . "\r\n";
$message = wordwrap($message, 70);

mail("recievers@gmail.com", $subject, $message, $headers);
echo "Your mail has been sent successfuly!";
}
}
}
?>
#wrapper
{
width:100%;
height:auto;	
margin:0px;
background-color:orange;
}

#navbar
{
height:60px;
width:100%;
background-color:black;
color:white;
float:left;
    
}

 ul li
{
display: block;
position: relative;
padding:20px 20px;
float:left;
}
ul li a
{
	color:white;
}
#navbar a:hover
{
	color:red;
	padding:5px;
}
.carousel-inner > .item > img,
  .carousel-inner > .item > a > img 
  {
      width: 70%;
      height:15%;
      margin: auto;
      background-color:white;
  }

.thumbnail
{
height:300px;
width:300px;
padding:25px auto;
margin:5px;

}

.contact
{
width:60%;
height:300px;
background-color:grey;
padding:100px 25px;
float:left;
}

.enquiry
{
width:40%;
height:300px;
background-color:seagreen;
float:left;
padding-left:5px;	
}
input[type=text]:focus {
    border: 3px solid red;
}
input[type="text"] 
{
	margin: 0 0 15px 0;
}

.footer
{
height:60px;
width:100%;
background-color:black;
padding:10px;
color:white;
float:left;
}
.footer img
{
float:right;
margin:5px;
padding:5px;

}
<!doctype html>
<html>
<head>
<title>student</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
  <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<div id="wrapper"><!--start wrapper-->
<div id="navbar"><!--start nav-->
<ul>
<li><a href="home.html">Home</li>
<li><a href="about.html">About us</li>
<li><a href="services.html">Services</li>
<li><a href="products.html">Products</li>
<li><a href="contact.html">Contact us</li>
</ul>
</div><!--end nav-->
<div id="myCarousel" class="carousel slide" data-ride="carousel"><!--carasel start-->
  <!-- Indicators -->
  <ol class="carousel-indicators">
    <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
    <li data-target="#myCarousel" data-slide-to="1"></li>
    <li data-target="#myCarousel" data-slide-to="2"></li>
    <li data-target="#myCarousel" data-slide-to="3"></li>
    <li data-target="#myCarousel" data-slide-to="4"></li>

  </ol>

  <!-- Wrapper for slides -->
  <div class="carousel-inner" role="listbox">
    <div class="item active">
      <img src="D:\task\photo\h.jpg" alt="Home" height="400px">
      <div class="carousel-caption">
        <h3>Home</h3>
              </div>
    </div>

    <div class="item">
      <img src="D:\task\photo\as.jpg" alt="About us" height="400px">
      <div class="carousel-caption">
        <h3>About us</h3>
       </div>
    </div>

    <div class="item">
      <img src="D:\task\photo\s.jpg" alt="Services" height="400px">
      <div class="carousel-caption">
        <h3>Services</h3>
             </div>
    </div>
    <div class="item">
      <img src="D:\task\photo\p.jpg" alt="Products" height="400px"> 
      <div class="carousel-caption">
        <h3>products</h3>
             </div>
    </div>
    <div class="item">
      <img src="D:\task\photo\c.jpg" alt="Contact us" height="400px">
      <div class="carousel-caption">
        <h3>Contact us</h3>
             </div>
    </div>
  </div>

  <!-- Left and right controls -->
  <a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
    <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
    <span class="sr-only">Previous</span>
  </a>
  <a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
    <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
    <span class="sr-only">Next</span>
  </a>
</div><!--end carosel-->

<div class="container-fluid text-center bg-grey"><!--boxes-->
  <div class="row text-center">
    <div class="col-sm-4">
      <div class="thumbnail">
        <img src="D:\task\photo\i.jpg" alt="Innovation">
        <p><strong>Innovation</strong></p>
      </div>
    </div>
    <div class="col-sm-4">
      <div class="thumbnail">
        <img src="D:\task\photo\cr.png" alt="Creative">
        <p><strong>Creativity</strong></p>
      </div>
    </div>
    <div class="col-sm-4">
      <div class="thumbnail">
        <img src="D:\task\photo\po.jpg" alt="Positive">
        <p><strong>Positivity</strong></p>
              </div>
    </div>
</div><!--end boxes-->


<div id="con">
<div class="contact">
<h1>Address</h1>
<p><span class="glyphicon glyphicon-map-marker"></span>
Abc private limited
no54,2ndstreet,
madipakkam,
chennai-67.
</p>
 <p><span class="glyphicon glyphicon-envelope"></span> ABCPVT@gmail.com</p>
</div>
<div class="enquiry">
<h1>Enquiry Form</h1>

<table border="0" align="center">
<form name="form" action="email.php" id="form" method="post">
<tr>
<tr>
<td>Name</td>
<td><input name="name" placeholder="Name" type="text" value=""></td>
</tr>

<tr>
<td>Email</td>
<td><input name="email" placeholder="Email" type="text" value=""></td>
</tr>

<tr>
<td>Phone</td>
<td><input name="phone" placeholder="phonenumber" type="text" value=""></td>
</tr>

<tr>
<td>Message</td>
<td><textarea name="msg" placeholder="Type your text here..."></textarea></td>
</tr>
<td colspan="2" style="text-align:center"><input id="send" name="submit" type="submit" value="Submit"></td>
</tr>
</form>
</table>

</div>
</div>
<div class="footer">
copyrights &copy; to WWW.abcpvt.com
<img src="E:\photos\fb.png" alt="fb"/>
<img src="E:\photos\ln.png" alt="tweet"/>
<img src="E:\photos\tw.png" alt="linkedin"/>
</div>

</div><!--end wrapper-->
</body>
</html>

最佳答案

您可以使用 sendmail 包从本地主机发送邮件,sendmail 包在 XAMPP 中是内置的。因此,如果您使用 XAMPP,那么您可以轻松地从本地主机发送邮件。

例如你可以配置C:\xampp\php\php.inic:\xampp\sendmail\sendmail.ini让gmail发送邮件。

在 C:\xampp\php\php.ini 中找到 extension=php_openssl.dll 并从该行的开头删除分号以使 SSL 为本地主机的 gmail 工作。

在php.ini文件中找到【邮件功能】并修改

SMTP=smtp.gmail.com

smtp_port=587

sendmail_from = my-gmail-id@gmail.com

sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"

现在打开 C:\xampp\sendmail\sendmail.ini。用以下代码替换 sendmail.ini 中的所有现有代码

[sendmail]

smtp_server=smtp.gmail.com
smtp_port=587
error_logfile=error.log
debug_logfile=debug.log
auth_username=my-gmail-id@gmail.com
auth_password=my-gmail-password
force_sender=my-gmail-id@gmail.com

现在你已经完成了!!使用邮件功能创建 php 文件并从本地主机发送邮件。

PS:不要忘记替换上面代码中的 my-gmail-id 和 my-gmail-password。另外,如果您从上面复制了设置,请不要忘记删除重复的键。例如,如果有另一个 sendmail_path,则在下面的行中注释:

sendmail_`path="C:\xampp\mailtodisk\mailtodisk.exe"

在php.ini文件中

还记得使用 XAMMP 控制面板重新启动服务器以使更改生效。

XMail or hMailServer can do the trick.

try PHPMailer

关于php - 在此页面中悬停不起作用,我不知道为什么,即使我已经给了它,页脚也没有占用 100% 的宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39137548/

相关文章:

php - 服务器中的图像未出现在 WordPress 媒体库中

javascript - 焦点事件后防止点击

iphone - 修复了 iPhone Safari 上的背景

html - 如何在 html/css 中对齐 'a' 元素

php - 使用 PHP 将字符串中的 <br> 替换为空格

javascript - 将选定的选项附加到 FormData

php - 使用 PHP 连接到 Microsoft SQL 服务器

html - CSS 导航栏不跨越全长

php - 如何使动态内容的链接发挥作用

html - 居中图片并隐藏选项卡