2010-05-13 59 views
1

我建立一個PHP登記表這需要以下字段多達20名運動員:任何方式來鞏固這段代碼?

名字中間名縮寫姓 聯合會號碼地址城市州 郵編DOB SSN電話電子郵件

我只通過每個戰鬥機的7個領域,我的PHP文件非常大(超過40kb)。有沒有辦法整合這些代碼?我還需要驗證每個領域的信息(正如我所說的 - 20個運動員x 12個領域= 240個驗證在一個頁面上)。

如果我可以發送任何進一步的代碼讓我知道!

<form id="Form" action="<?php $_SERVER['PHP_SELF']; ?>" method="post" name="Form" onsubmit="return Enroll_Form_Validator(this)"> 
<p class="title">Your Fighters' Information</p> 
<p>Please complete the following fields with your <span style="color:red;"> Fighters' Information</span> to continue your enrollment.</p> 
<br /> 

<?php 
    // if $errors is not empty, the form must have failed one or more validation 
    // tests. Loop through each and display them on the page for the user 
    if (!empty($errors)) 
    { 
     echo "<div class='error'>Please fix the following errors:\n<ul>"; 
     foreach ($errors as $error) 
     echo "<li>$error</li>\n"; 

     echo "</ul></div>"; 
    }  
?> 

<?php if ($_SESSION['Num_Fighters'] > "0") { ?> 
    <table class="demoTable"> 
    <tr> 
     <td>First Name: </td> 
     <td><input type="text" name="F1FirstName" onkeyup="if(!this.value.match(/^([a-z]+\s?)*$/i))this.value=this.value.replace(/[^a-z ]/ig,'').replace(/\s+/g,' ')" value="<?php echo $fields['F1FirstName']; ?>" /></td> 
    </tr> 
    <tr> 
     <td>Middle Initial: </td> 
     <td><input type="text" name="F1MI" size="2" maxlength="1" onkeyup="if(!this.value.match(/^([a-z]+\s?)*$/i))this.value=this.value.replace(/[^a-z ]/ig,'').replace(/\s+/g,' ')" value="<?php echo $fields['F1MI']; ?>" /></td> 
    </tr> 
    <tr> 
     <td>Last Name: </td> 
     <td><input type="text" name="F1LastName" onkeyup="if(!this.value.match(/^([a-z]+\s?)*$/i))this.value=this.value.replace(/[^a-z ]/ig,'').replace(/\s+/g,' ')" value="<?php echo $fields['F1LastName']; ?>" /></td> 
    </tr> 
    <tr> 
     <td>Federation No: </td> 
     <td><input type="text" name="F1FedNum" maxlength="10" onkeyup="this.value=this.value.replace(/[^0-9]/ig, '')" value="<?php echo $fields['F1FedNum']; ?>" /></td> 
    </tr> 
    <tr> 
     <td>SSN: </td> 
     <td><input type="text" name="F1SSN1" size="3" maxlength="3" onkeyup="this.value=this.value.replace(/[^0-9]/ig, '')" value="<?php echo $fields['F1SSN1']; ?>" /> - 
     <input type="text" name="F1SSN2" size="2" maxlength="2" onkeyup="this.value=this.value.replace(/[^0-9]/ig, '')" value="<?php echo $fields['F1SSN2']; ?>" /> - 
     <input type="text" name="F1SSN3" size="4" maxlength="4" onkeyup="this.value=this.value.replace(/[^0-9]/ig, '')" value="<?php echo $fields['F1SSN3']; ?>" /> 
     </td> 
    </tr> 
    <tr> 
     <td>Date of Birth</td> 
     <td> 
     <select name="F1DOB1"> 
      <option value="">Month</option> 
      <?php 
       for ($i=1; $i<=12; $i++) 
      { 
      echo "<option value='$i'"; 
      if ($fields["F1DOB1"] == $i) 
       echo " selected"; 
      echo ">$i</option>"; 
      } 
      ?>    
     </select>/
     <select name="F1DOB2"> 
      <option value="">Day</option> 
      <?php 
       for ($i=1; $i<=31; $i++) 
      { 
      echo "<option value='$i'"; 
      if ($fields["F1DOB2"] == $i) 
       echo " selected"; 
      echo ">$i</option>"; 
      } 
      ?> 
     </select>/
     <select name="F1DOB3"> 
      <option value="">Year</option> 
      <?php 
       for ($i=date('Y'); $i>=1900; $i--) 
      { 
      echo "<option value='$i'"; 
      if ($fields["F1DOB3"] == $i) 
       echo " selected"; 
      echo ">$i</option>"; 
      } 
      ?> 
     </select> 
     </td> 
    </tr> 
    <tr> 
     <td>Address: </td> 
     <td><input type="text" name="F1Address" value="<?php echo $fields['F1Address']; ?>" /></td> 
    </tr> 
    <tr> 
     <td>City: </td> 
     <td><input type="text" name="F1City" onkeyup="if(!this.value.match(/^([a-z]+\s?)*$/i))this.value=this.value.replace(/[^a-z ]/ig,'').replace(/\s+/g,' ')" value="<?php echo $fields['F1City']; ?>" /></td> 
    </tr> 
    <tr> 
     <td>State: </td> 
     <td><select name="F1State"><option value="">Choose a State</option><?php showOptionsDrop($states_arr, null, true); ?></select></td> 
    </tr> 
    <tr> 
     <td>Zip Code: </td> 
     <td><input type="text" name="F1Zip" size="6" maxlength="5" onkeyup="this.value=this.value.replace(/[^0-9]/ig, '')" value="<?php echo $fields['F1Zip']; ?>" /></td> 
    </tr> 
    <tr> 
     <td>Contact Telephone No: </td> 
     <td>(<input type="text" name="F1Phone1" size="3" maxlength="3" onkeyup="this.value=this.value.replace(/[^0-9]/ig, '')" value="<?php echo $fields['F1Phone1']; ?>" />) 
     <input type="text" name="F1Phone2" size="3" maxlength="3" onkeyup="this.value=this.value.replace(/[^0-9]/ig, '')" value="<?php echo $fields['F1Phone2']; ?>" /> - 
     <input type="text" name="F1Phone3" size="4" maxlength="4" onkeyup="this.value=this.value.replace(/[^0-9]/ig, '')" value="<?php echo $fields['F1Phone3']; ?>" /> 
     </td> 
    </tr> 
    <tr> 
     <td>Email:</td> 
     <td><input type="text" name="F1Email" value="<?php echo $fields['F1Email']; ?>" /></td> 
    </tr>  
    </table> 
<?php } ?> 
<br /> 
<?php if ($_SESSION['Num_Fighters'] > "1") { ?> 
    <table class="demoTable"> 
    <tr> 
     <td>First Name: </td> 
     <td><input type="text" name="F2FirstName" onkeyup="if(!this.value.match(/^([a-z]+\s?)*$/i))this.value=this.value.replace(/[^a-z ]/ig,'').replace(/\s+/g,' ')" value="<?php echo $fields['F2FirstName']; ?>" /></td> 
    </tr> 
    <tr> 
     <td>Middle Initial: </td> 
     <td><input type="text" name="F2MI" size="2" maxlength="1" onkeyup="if(!this.value.match(/^([a-z]+\s?)*$/i))this.value=this.value.replace(/[^a-z ]/ig,'').replace(/\s+/g,' ')" value="<?php echo $fields['F2MI']; ?>" /></td> 
    </tr> 
    <tr> 
     <td>Last Name: </td> 
     <td><input type="text" name="F2LastName" onkeyup="if(!this.value.match(/^([a-z]+\s?)*$/i))this.value=this.value.replace(/[^a-z ]/ig,'').replace(/\s+/g,' ')" value="<?php echo $fields['F2LastName']; ?>" /></td> 
    </tr> 
    <tr> 
     <td>Federation No: </td> 
     <td><input type="text" name="F2FedNum" maxlength="10" onkeyup="this.value=this.value.replace(/[^0-9]/ig, '')" value="<?php echo $fields['F2FedNum']; ?>" /></td> 
    </tr> 
    <tr> 
     <td>SSN: </td> 
     <td><input type="text" name="F2SSN1" size="3" maxlength="3" onkeyup="this.value=this.value.replace(/[^0-9]/ig, '')" value="<?php echo $fields['F2SSN1']; ?>" /> - 
     <input type="text" name="F2SSN2" size="2" maxlength="2" onkeyup="this.value=this.value.replace(/[^0-9]/ig, '')" value="<?php echo $fields['F2SSN2']; ?>" /> - 
     <input type="text" name="F2SSN3" size="4" maxlength="4" onkeyup="this.value=this.value.replace(/[^0-9]/ig, '')" value="<?php echo $fields['F2SSN3']; ?>" /> 
     </td> 
    </tr> 
    <tr> 
     <td>Date of Birth</td> 
     <td> 
     <select name="F2DOB1"> 
      <option value="">Month</option> 
      <?php 
       for ($i=1; $i<=12; $i++) 
      { 
      echo "<option value='$i'"; 
      if ($fields["F2DOB1"] == $i) 
       echo " selected"; 
      echo ">$i</option>"; 
      } 
      ?>    
     </select>/
     <select name="F2DOB2"> 
      <option value="">Day</option> 
      <?php 
       for ($i=1; $i<=31; $i++) 
      { 
      echo "<option value='$i'"; 
      if ($fields["F2DOB2"] == $i) 
       echo " selected"; 
      echo ">$i</option>"; 
      } 
      ?> 
     </select>/
     <select name="F2DOB3"> 
      <option value="">Year</option> 
      <?php 
       for ($i=date('Y'); $i>=1900; $i--) 
      { 
      echo "<option value='$i'"; 
      if ($fields["F2DOB3"] == $i) 
       echo " selected"; 
      echo ">$i</option>"; 
      } 
      ?> 
     </select> 
     </td> 
    </tr> 
    <tr> 
     <td>Address: </td> 
     <td><input type="text" name="F2Address" value="<?php echo $fields['F2Address']; ?>" /></td> 
    </tr> 
    <tr> 
     <td>City: </td> 
     <td><input type="text" name="F2City" onkeyup="if(!this.value.match(/^([a-z]+\s?)*$/i))this.value=this.value.replace(/[^a-z ]/ig,'').replace(/\s+/g,' ')" value="<?php echo $fields['F2City']; ?>" /></td> 
    </tr> 
    <tr> 
     <td>State: </td> 
     <td><select name="F2State"><option value="">Choose a State</option><?php showOptionsDrop($states_arr, null, true); ?></select></td> 
    </tr> 
    <tr> 
     <td>Zip Code: </td> 
     <td><input type="text" name="F2Zip" size="6" maxlength="5" onkeyup="this.value=this.value.replace(/[^0-9]/ig, '')" value="<?php echo $fields['F2Zip']; ?>" /></td> 
    </tr> 
    <tr> 
     <td>Contact Telephone No: </td> 
     <td>(<input type="text" name="F2Phone1" size="3" maxlength="3" onkeyup="this.value=this.value.replace(/[^0-9]/ig, '')" value="<?php echo $fields['F2Phone1']; ?>" />) 
     <input type="text" name="F2Phone2" size="3" maxlength="3" onkeyup="this.value=this.value.replace(/[^0-9]/ig, '')" value="<?php echo $fields['F2Phone2']; ?>" /> - 
     <input type="text" name="F2Phone3" size="4" maxlength="4" onkeyup="this.value=this.value.replace(/[^0-9]/ig, '')" value="<?php echo $fields['F2Phone3']; ?>" /> 
     </td> 
    </tr> 
    <tr> 
     <td>Email:</td> 
     <td><input type="text" name="F2Email" value="<?php echo $fields['F2Email']; ?>" /></td> 
    </tr>  
    </table> 
<?php } ?> 
<br /> 
<?php if ($_SESSION['Num_Fighters'] > "2") { ?> 
    <table class="demoTable"> 
    <tr> 
     <td>First Name: </td> 
     <td><input type="text" name="F3FirstName" onkeyup="if(!this.value.match(/^([a-z]+\s?)*$/i))this.value=this.value.replace(/[^a-z ]/ig,'').replace(/\s+/g,' ')" value="<?php echo $fields['F3FirstName']; ?>" /></td> 
    </tr> 
    <tr> 
     <td>Middle Initial: </td> 
     <td><input type="text" name="F3MI" size="2" maxlength="1" onkeyup="if(!this.value.match(/^([a-z]+\s?)*$/i))this.value=this.value.replace(/[^a-z ]/ig,'').replace(/\s+/g,' ')" value="<?php echo $fields['F3MI']; ?>" /></td> 
    </tr> 
    <tr> 
     <td>Last Name: </td> 
     <td><input type="text" name="F3LastName" onkeyup="if(!this.value.match(/^([a-z]+\s?)*$/i))this.value=this.value.replace(/[^a-z ]/ig,'').replace(/\s+/g,' ')" value="<?php echo $fields['F3LastName']; ?>" /></td> 
    </tr> 
    <tr> 
     <td>Federation No: </td> 
     <td><input type="text" name="F3FedNum" maxlength="10" onkeyup="this.value=this.value.replace(/[^0-9]/ig, '')" value="<?php echo $fields['F3FedNum']; ?>" /></td> 
    </tr> 
    <tr> 
     <td>SSN: </td> 
     <td><input type="text" name="F3SSN1" size="3" maxlength="3" onkeyup="this.value=this.value.replace(/[^0-9]/ig, '')" value="<?php echo $fields['F3SSN1']; ?>" /> - 
     <input type="text" name="F3SSN2" size="2" maxlength="2" onkeyup="this.value=this.value.replace(/[^0-9]/ig, '')" value="<?php echo $fields['F3SSN2']; ?>" /> - 
     <input type="text" name="F3SSN3" size="4" maxlength="4" onkeyup="this.value=this.value.replace(/[^0-9]/ig, '')" value="<?php echo $fields['F3SSN3']; ?>" /> 
     </td> 
    </tr> 
    <tr> 
     <td>Date of Birth</td> 
     <td> 
     <select name="F3DOB1"> 
      <option value="">Month</option> 
      <?php 
       for ($i=1; $i<=12; $i++) 
      { 
      echo "<option value='$i'"; 
      if ($fields["F3DOB1"] == $i) 
       echo " selected"; 
      echo ">$i</option>"; 
      } 
      ?>    
     </select>/
     <select name="F3DOB2"> 
      <option value="">Day</option> 
      <?php 
       for ($i=1; $i<=31; $i++) 
      { 
      echo "<option value='$i'"; 
      if ($fields["F3DOB2"] == $i) 
       echo " selected"; 
      echo ">$i</option>"; 
      } 
      ?> 
     </select>/
     <select name="F3DOB3"> 
      <option value="">Year</option> 
      <?php 
       for ($i=date('Y'); $i>=1900; $i--) 
      { 
      echo "<option value='$i'"; 
      if ($fields["F3DOB3"] == $i) 
       echo " selected"; 
      echo ">$i</option>"; 
      } 
      ?> 
     </select> 
     </td> 
    </tr> 
    <tr> 
     <td>Address: </td> 
     <td><input type="text" name="F3Address" value="<?php echo $fields['F3Address']; ?>" /></td> 
    </tr> 
    <tr> 
     <td>City: </td> 
     <td><input type="text" name="F3City" onkeyup="if(!this.value.match(/^([a-z]+\s?)*$/i))this.value=this.value.replace(/[^a-z ]/ig,'').replace(/\s+/g,' ')" value="<?php echo $fields['F3City']; ?>" /></td> 
    </tr> 
    <tr> 
     <td>State: </td> 
     <td><select name="F3State"><option value="">Choose a State</option><?php showOptionsDrop($states_arr, null, true); ?></select></td> 
    </tr> 
    <tr> 
     <td>Zip Code: </td> 
     <td><input type="text" name="F3Zip" size="6" maxlength="5" onkeyup="this.value=this.value.replace(/[^0-9]/ig, '')" value="<?php echo $fields['F3Zip']; ?>" /></td> 
    </tr> 
    <tr> 
     <td>Contact Telephone No: </td> 
     <td>(<input type="text" name="F3Phone1" size="3" maxlength="3" onkeyup="this.value=this.value.replace(/[^0-9]/ig, '')" value="<?php echo $fields['F3Phone1']; ?>" />) 
     <input type="text" name="F3Phone2" size="3" maxlength="3" onkeyup="this.value=this.value.replace(/[^0-9]/ig, '')" value="<?php echo $fields['F3Phone2']; ?>" /> - 
     <input type="text" name="F3Phone3" size="4" maxlength="4" onkeyup="this.value=this.value.replace(/[^0-9]/ig, '')" value="<?php echo $fields['F3Phone3']; ?>" /> 
     </td> 
    </tr> 
    <tr> 
     <td>Email:</td> 
     <td><input type="text" name="F3Email" value="<?php echo $fields['F3Email']; ?>" /></td> 
    </tr>  
    </table> 
<?php } ?> 
<br /> 
<?php if ($_SESSION['Num_Fighters'] > "3") { ?> 
    <table class="demoTable"> 
    <tr> 
     <td>First Name: </td> 
     <td><input type="text" name="F4FirstName" onkeyup="if(!this.value.match(/^([a-z]+\s?)*$/i))this.value=this.value.replace(/[^a-z ]/ig,'').replace(/\s+/g,' ')" value="<?php echo $fields['F4FirstName']; ?>" /></td> 
    </tr> 
    <tr> 
     <td>Middle Initial: </td> 
     <td><input type="text" name="F4MI" size="2" maxlength="1" onkeyup="if(!this.value.match(/^([a-z]+\s?)*$/i))this.value=this.value.replace(/[^a-z ]/ig,'').replace(/\s+/g,' ')" value="<?php echo $fields['F4MI']; ?>" /></td> 
    </tr> 
    <tr> 
     <td>Last Name: </td> 
     <td><input type="text" name="F4LastName" onkeyup="if(!this.value.match(/^([a-z]+\s?)*$/i))this.value=this.value.replace(/[^a-z ]/ig,'').replace(/\s+/g,' ')" value="<?php echo $fields['F4LastName']; ?>" /></td> 
    </tr> 
    <tr> 
     <td>Federation No: </td> 
     <td><input type="text" name="F4FedNum" maxlength="10" onkeyup="this.value=this.value.replace(/[^0-9]/ig, '')" value="<?php echo $fields['F4FedNum']; ?>" /></td> 
    </tr> 
    <tr> 
     <td>SSN: </td> 
     <td><input type="text" name="F4SSN1" size="3" maxlength="3" onkeyup="this.value=this.value.replace(/[^0-9]/ig, '')" value="<?php echo $fields['F4SSN1']; ?>" /> - 
     <input type="text" name="F4SSN2" size="2" maxlength="2" onkeyup="this.value=this.value.replace(/[^0-9]/ig, '')" value="<?php echo $fields['F4SSN2']; ?>" /> - 
     <input type="text" name="F4SSN3" size="4" maxlength="4" onkeyup="this.value=this.value.replace(/[^0-9]/ig, '')" value="<?php echo $fields['F4SSN3']; ?>" /> 
     </td> 
    </tr> 
    <tr> 
     <td>Date of Birth</td> 
     <td> 
     <select name="F4DOB1"> 
      <option value="">Month</option> 
      <?php 
       for ($i=1; $i<=12; $i++) 
      { 
      echo "<option value='$i'"; 
      if ($fields["F4DOB1"] == $i) 
       echo " selected"; 
      echo ">$i</option>"; 
      } 
      ?>    
     </select>/
     <select name="F4DOB2"> 
      <option value="">Day</option> 
      <?php 
       for ($i=1; $i<=31; $i++) 
      { 
      echo "<option value='$i'"; 
      if ($fields["F4DOB2"] == $i) 
       echo " selected"; 
      echo ">$i</option>"; 
      } 
      ?> 
     </select>/
     <select name="F4DOB3"> 
      <option value="">Year</option> 
      <?php 
       for ($i=date('Y'); $i>=1900; $i--) 
      { 
      echo "<option value='$i'"; 
      if ($fields["F4DOB3"] == $i) 
       echo " selected"; 
      echo ">$i</option>"; 
      } 
      ?> 
     </select> 
     </td> 
    </tr> 
    <tr> 
     <td>Address: </td> 
     <td><input type="text" name="F4Address" value="<?php echo $fields['F4Address']; ?>" /></td> 
    </tr> 
    <tr> 
     <td>City: </td> 
     <td><input type="text" name="F4City" onkeyup="if(!this.value.match(/^([a-z]+\s?)*$/i))this.value=this.value.replace(/[^a-z ]/ig,'').replace(/\s+/g,' ')" value="<?php echo $fields['F4City']; ?>" /></td> 
    </tr> 
    <tr> 
     <td>State: </td> 
     <td><select name="F4State"><option value="">Choose a State</option><?php showOptionsDrop($states_arr, null, true); ?></select></td> 
    </tr> 
    <tr> 
     <td>Zip Code: </td> 
     <td><input type="text" name="F4Zip" size="6" maxlength="5" onkeyup="this.value=this.value.replace(/[^0-9]/ig, '')" value="<?php echo $fields['F4Zip']; ?>" /></td> 
    </tr> 
    <tr> 
     <td>Contact Telephone No: </td> 
     <td>(<input type="text" name="F4Phone1" size="3" maxlength="3" onkeyup="this.value=this.value.replace(/[^0-9]/ig, '')" value="<?php echo $fields['F4Phone1']; ?>" />) 
     <input type="text" name="F4Phone2" size="3" maxlength="3" onkeyup="this.value=this.value.replace(/[^0-9]/ig, '')" value="<?php echo $fields['F4Phone2']; ?>" /> - 
     <input type="text" name="F4Phone3" size="4" maxlength="4" onkeyup="this.value=this.value.replace(/[^0-9]/ig, '')" value="<?php echo $fields['F4Phone3']; ?>" /> 
     </td> 
    </tr> 
    <tr> 
     <td>Email:</td> 
     <td><input type="text" name="F4Email" value="<?php echo $fields['F4Email']; ?>" /></td> 
    </tr>  
    </table> 
<?php } ?> 
<div align="right"><input class="enrbutton" type="submit" name="submit" value="Continue" /></div> 
</form> 

這隻會通過4名運動員,我需要它捕捉20.任何想法?假設某人招募了20名運動員,我不得不在SESSION中保留所有200多個元素。

+0

我還沒有仔細閱讀過代碼,但是難道你不能把它作爲一個函數來調用1,2,3 ... 20次嗎? – Shelldon 2010-05-13 23:02:38

+0

@Shelldon - 我想這就是我要找的東西,但不知道如何去做。我需要輸入的信息是唯一的(即它不能全部存儲爲名字;它必須被放置爲F1FirstName,F2FirstName,其中F1和F2是運動員標識符) – JM4 2010-05-13 23:08:08

回答

4
  1. Throw this code away
  2. Seperate your html files from your php code.
  3. 如果您的 雄心勃勃,請使用MVC pattern
  4. 使用a validation class.
  5. 利潤!
+0

感謝您的建議。 PHP(使用包含文件等)。當你使用這個表單的時候,你是如何推薦將它們分開的?我在同一頁面上進行了驗證(因爲我想在同一頁面上返回錯誤並保持輸入的信息不變頁面也是如此) 我已經在頁面頂部使用了一個驗證類,它基於我在頁面頂部定義的'規則'的require_once()。 – JM4 2010-05-13 23:07:07

+0

通讀我發給你的鏈接。具體來說,請查看Jeremy在下面討論的Zend表單鏈接,你會驚訝地發現你的40kb表單變成了一個2kb的表單,更漂亮,更容易維護。他Zend快速入門,它只是複製和粘貼,但它會打開你的眼睛看看如何寫好PHP的外觀。一開始看起來會更加困難,但相信我,當你得到它時,它會是最大的哈哈!自從學習編碼以來的一刻。真。 祝你好運! – 2010-05-13 23:24:03

+0

感謝拜倫的建議。我肯定會在本週進行討論。在此期間,我可能不得不忍受我的垃圾代碼,因爲我們正在爲我們正在構建的項目(這一項)進行實時運行。我現在遇到的其他語言中無法找到的一件事就是能夠標記字段輸入並動態驗證它們。我需要存儲我收集的所有信息,但從不打算將它用於任何事情,因此查詢數據庫是毫無意義的。我們只是簡單地捕獲並傳遞一段時間,所以對我來說最重要的是規模和速度 - 不會分離 – JM4 2010-05-13 23:32:01

2

形式可能是一個真正的痛苦。我與拜倫合作,但我想進一步指出,您不必使用Zend的MVC組件來使用Zend Form。我將Zend Form插入我的一些非mvc項目中獲得了很多里程。

+0

@Jeremy - 感謝拜倫的提示。我完全不熟悉Zend Form(以及Zend Framework在這方面的總體情況)。使用它比傳統的html/php表單構建有什麼優勢? – JM4 2010-05-13 23:18:39

+0

@Jeremy +1關於Zend的最好的部分是它的模塊化,你可以使用你想要的任何部分而不使用整個框架。 – 2010-05-13 23:26:47

+0

@ JM4 - 使用代碼庫而不是「滾動自己」的好處是,幾乎所有你想要或者需要做的事情都已經完成了,不需要自己做。特定於Zend表單,輸入驗證,過濾,html代碼生成和錯誤消息生成和處理都是爲您處理的,並且都是可重用的。 – 2010-05-13 23:29:48