2013-08-05 56 views
0

我用CSS模板下載了一個html。在登錄表單(其中最初被藍色按鈕CSS的作品。我複製的按鈕相同的HTML代碼到另一個區域,當我點擊它不工作。

CSS

.blue-button { 
    display: inline-block; 
    vertical-align: top; 
    border: solid 1px #6d8794; 
    position: relative; 
    border: solid 1px #6d8794; 
    -moz-border-radius: 4px; 
    -webkit-border-radius: 4px; 
    border-radius: 4px; 
    behavior: url(css/PIE.php); 
} 

.blue-button span { 
    display: inline-block; 
    vertical-align: top; 
    border: solid 1px #6d8794; 
    position: relative; 
    border: solid 1px #a6bcc8; 
    background: #85a3b3 url("../images/blue-button-stripes.gif") repeat-x left top; 
    color: #fff; 
    line-height: 26px; 
    -moz-border-radius: 3px; 
    -webkit-border-radius: 3px; 
    border-radius: 3px; 
    behavior: url(css/PIE.php); 
} 

.blue-button a, .blue-button input { 
    border: 0px; 
    padding: 0px 15px; 
    height: 26px; 
    color: #fff; 
    font-weight: bold; 
    font-size: 13px; 
    font-family: Helvetica; 
    text-shadow: 0px 1px #687b85; 
    text-transform: uppercase; 
    text-decoration: none; 
    cursor: pointer; 
    background: none; 
} 

.blue-button:hover a, .blue-button:hover input { 
    text-decoration: underline; 
} 

PHP

public function ShowLoginPanel() 
{  

$this->LoginContent= 
' <div class="column-1-3"> 
     <div class="white-box"> 

      <div class="box-content fixed-height"> 
       <form action="" method="post" class="contact-form"> 
        <div> 
          <span class="blue-button"><span><input type="submit" value="SEND &raquo;" /></span></span> 
         </div> 
         <input type="hidden" name="val" value="checkin"> 
        </div> 
       </form> 
      </div> 
     </div> 
    </div><!--/end .column-1-3 --> ';  

} 

當我點擊該按鈕時,$ _ POST [ 「VAL」]設置,但是當我使用相同的代碼在另一個單元(例如爲registration.php)

 <div class="icon"><img src="images/register.png" alt="" /></div> 
    <input type="hidden" name="val" value="registration">';  

$ _POST [「val」]未設置,它什麼也不做。

你可以從這裏http://tinyurl.com/pkw5wly訪問我頁面爲了做一個總結,我的問題是,爲什麼在洛的div按鈕的作品,但在註冊DIV它不工作

+1

這不會是一個CSS問題。您的'

'在發佈的代碼中沒有'action'。 「行動」集在哪裏? – ken

+0

您可以訪問該頁面。 – user558126

+1

@LoganMurphy'post'將是方法。 「行動」將成爲您希望表單擊中的頁面。 –

回答

0

您不能訪問$ _ POST [「VAL」除非你是提交表單具有post

<form method="post" action="handler.php"> 
    <input name="val"/> 
    <input type="submit"/> 
</form> 

一個method然後你可以否則訪問$ _ POST變量

echo $_POST["val"]; 

可以設置爲method="get"(或者未指定非常有可能的方法)並使用$ _GET變量

echo $_GET["val"]; 
+0

謝謝,這是解決方案! – user558126

1

註冊按鈕不可在任何form,所以點擊它什麼都不做。

解決方案:在登記輸入周圍放置一個form

+0

非常感謝,這是解決方案! – user558126