2017-07-08 33 views
0
使用我的PHP來顯示結果到我的網頁

,我用做了一點的造型啓用面板引導當PHP被執行,除非其隱藏

<div class="alert alert-success" role="alert"> 
     <?php  
     if(isset($_POST['submit'])){ //check if form was submitted 
     include "assets/backend/newsletter.php"; 
     } 
     ?> 
</div> 

即使不執行的PHP代碼中,我可以看到空白麪板。 我該如何擺脫?

回答

1

[圖片供參考。] [1]我想在你們的情況下,這種方式使得更多的SENS那麼什麼是U在那裏做:

<?php  
if(isset($_POST['submit'])){ ?> 
<div class="alert alert-success" role="alert"> 
<?php include "assets/backend/newsletter.php"; ?> 
</div> 
<?php}?> 

如果提交表單的面板會出現這樣如果未提交,面板將不可見。

footer.php 
<div class="container"> 
    <div class="row"> 
    <?php  
     if(isset($_POST['submit'])){ 
      echo '<div class="alert alert-success" role="alert"> '; 
      include 'assets/backend/newsletter.php'; 
      echo '</div>'; 
     } 
     ?> 
    </div> 

<div class="container-fluid" style="background-color:#222222"> 
    <div class="row"> 
     <div class="container" style="margin-top:15px; 
      margin-bottom:15px"> 
      <div class="col-lg-4" style="color:#f3f6f9"> 
       <img src="images/pc%20logo.png" width="80px" height="80px"> 
       <h4 > 
        PLACEMENT 
        <cell style="font-weight:bold">CELL</cell> 
       </h4> 
       <p>Nehru Nagar, Ring Road <br>New Delhi <br> 
        Ph :(+91) 964 328 0581<br> 
        Email : [email protected] 
       </p> 
       <a href="https://www.facebook.com/pgdavplacements"> <img src="images/f.png" height="30px" width="30px" > 
       </a> 
       <img src="images/i.png" height="30px" width="30px"> 
       <img src="images/linkedin.png" height="30px" width="30px"> 
      </div> 
      <div class="col-lg-4" style="color:#f3f6f9; 
       padding-top:30px"> 
       <h4>Subscribe to Our Newsletter</h4> 
       <form action=" " method="post"> 
        <div class="form-group"> 
         <input class="form-control" type="text" 
          id="inputemail" name="email_newsletter" placeholder="Your Email ID"> 
        </div> 
        <input type="submit" name="submit" class="btn btn-default" value="subscribe"> 
       </form> 
      </div> 
      <div class="col-lg-4" style="color:#f3f6f9; 
       padding-top:29px"> 
       <h4>Links</h4> 
       <ol class="breadcrumb"> 
        <li><a href="index.php">Home</a></li> 
        <li><a href="aboutcell.php">About Cell</a></li> 
        <li><a href="">Registration</a></li> 
        <li><a href="contactus.php">Contact Us</a></li> 
       </ol> 
      </div> 
     </div> 

     <div class="container-fluid" style="background-color:#f3f6f9"> 
      <div class="row"> 
       <div class="container" style="padding-top:7px"> 
        <div class="col-lg-6 col-sm-12 col-xs-12">© All the Rights Reserved with Placement Cell</div> 
        <div class="col-lg-6 col-sm-12 col-xs-12" style="text-align:right"><a href="https://www.linkedin.com/in/bhanukrsingh/">Developed By Bhanu Singh</a></div> 
       </div> 
      </div> 
     </div> 
    </div> 
</div></div> 

或該:

<div class="container"> 
    <div class="row"> 
    <?php  
     if(isset($_POST['submit'])){ ?> 
     <div class="alert alert-success" role="alert"> 
      <?php 
      include 'assets/backend/newsletter.php'; 
      ?> 
      </div> 
     <?php 
     } 
     ?> 
    </div> 

<div class="container-fluid" style="background-color:#222222"> 
    <div class="row"> 
     <div class="container" style="margin-top:15px; 
      margin-bottom:15px"> 
      <div class="col-lg-4" style="color:#f3f6f9"> 
       <img src="images/pc%20logo.png" width="80px" height="80px"> 
       <h4 > 
        PLACEMENT 
        <cell style="font-weight:bold">CELL</cell> 
       </h4> 
       <p>Nehru Nagar, Ring Road <br>New Delhi <br> 
        Ph :(+91) 964 328 0581<br> 
        Email : [email protected] 
       </p> 
       <a href="https://www.facebook.com/pgdavplacements"> <img src="images/f.png" height="30px" width="30px" > 
       </a> 
       <img src="images/i.png" height="30px" width="30px"> 
       <img src="images/linkedin.png" height="30px" width="30px"> 
      </div> 
      <div class="col-lg-4" style="color:#f3f6f9; 
       padding-top:30px"> 
       <h4>Subscribe to Our Newsletter</h4> 
       <form action=" " method="post"> 
        <div class="form-group"> 
         <input class="form-control" type="text" 
          id="inputemail" name="email_newsletter" placeholder="Your Email ID"> 
        </div> 
        <input type="submit" name="submit" class="btn btn-default" value="subscribe"> 
       </form> 
      </div> 
      <div class="col-lg-4" style="color:#f3f6f9; 
       padding-top:29px"> 
       <h4>Links</h4> 
       <ol class="breadcrumb"> 
        <li><a href="index.php">Home</a></li> 
        <li><a href="aboutcell.php">About Cell</a></li> 
        <li><a href="">Registration</a></li> 
        <li><a href="contactus.php">Contact Us</a></li> 
       </ol> 
      </div> 
     </div> 

     <div class="container-fluid" style="background-color:#f3f6f9"> 
      <div class="row"> 
       <div class="container" style="padding-top:7px"> 
        <div class="col-lg-6 col-sm-12 col-xs-12">© All the Rights Reserved with Placement Cell</div> 
        <div class="col-lg-6 col-sm-12 col-xs-12" style="text-align:right"><a href="https://www.linkedin.com/in/bhanukrsingh/">Developed By Bhanu Singh</a></div> 
       </div> 
      </div> 
     </div> 
    </div> 
</div></div> 

測試的兩種選項都幹活;

+0

解析錯誤:語法錯誤,意外的文件末尾在C:\ xampp \ htdocs \ PlacementCell \ assets \ php \ footer.php上行 我收到一個錯誤。 –

+0

@Bhanusingh份額footer.php –

+0

我編輯我的答案和添加footer.php –

相關問題