2012-02-20 50 views
1

我的客戶端有一個由php生成的表單。他想自己編輯它,比如html表單的完成方式,重命名,移動文本框,添加文本框。直觀地更改php代碼

但不幸的是,程序員已經設計了它,以代替它只是說<php>的形式。客戶堅持必須有某種方式來做到這一點。有任何想法嗎。 我目前正在使用Dreamweaver。 這是代碼的一部分。

### BEGIN find any custom field labels ### 
$label_title =    'Title'; 
$label_first_name =   'First'; 
$label_middle_initial =  'MI'; 
$label_last_name =   'Last'; 
$label_address1 =   'Address1'; 
$label_address2 =   'Address2'; 
$label_address3 =   'Address3'; 
$label_city =    'City'; 
$label_state =    'State'; 
$label_province =   'Province'; 
$label_postal_code =  'PostCode'; 
$label_vendor_lead_code = 'Vendor ID'; 
$label_gender =    'Gender'; 
$label_phone_number =  'Phone'; 
$label_phone_code =   'DialCode'; 
$label_alt_phone =   'Alt. Phone'; 
$label_security_phrase = 'Show'; 
$label_email =    'Email'; 
$label_comments =   'Comments'; 

<table width="550px"><tr> 
    <td align="right"><font class="body_text"> 
    <?php 

    if ($label_title == '---HIDE---') 
     {echo "</td><td align=\"left\" colspan=\"5\"><input type=\"hidden\" name=\"title\" id=\"title\" value=\"\" />";} 
    else 
     {echo "$label_title: </td><td align=\"left\" colspan=\"5\"><font class=\"body_text\"><input type=\"text\" size=\"4\" name=\"title\" id=\"title\" maxlength=\"4\" class=\"cust_form\" value=\"\" />";} 
    if ($label_first_name == '---HIDE---') 
     {echo "&nbsp; <input type=\"hidden\" name=\"first_name\" id=\"first_name\" value=\"\" />";} 
    else 
     {echo "&nbsp; $label_first_name: <input type=\"text\" size=\"17\" name=\"first_name\" id=\"first_name\" maxlength=\"30\" class=\"cust_form\" value=\"\" />";} 
    if ($label_middle_initial == '---HIDE---') 
     {echo "&nbsp; <input type=\"hidden\" name=\"middle_initial\" id=\"middle_initial\" value=\"\" />";} 
    else 
     {echo "&nbsp; $label_middle_initial: <input type=\"text\" size=\"1\" name=\"middle_initial\" id=\"middle_initial\" maxlength=\"1\" class=\"cust_form\" value=\"\" />";} 
    if ($label_last_name == '---HIDE---') 
     {echo "&nbsp; <input type=\"hidden\" name=\"last_name\" id=\"last_name\" value=\"\" />";} 
    else 
     {echo "&nbsp; $label_last_name: <input type=\"text\" size=\"23\" name=\"last_name\" id=\"last_name\" maxlength=\"30\" class=\"cust_form\" value=\"\" />";} 

    echo "</td></tr><tr><td align=\"right\"><font class=\"body_text\">"; 

    if ($label_address1 == '---HIDE---') 
     {echo " </td><td align=\"left\" colspan=\"5\"><input type=\"hidden\" name=\"address1\" id=\"address1\" value=\"\" />";} 
    else 
     {echo "$label_address1: </td><td align=\"left\" colspan=5><font class=\"body_text\"><input type=\"text\" size=\"85\" name=\"address1\" id=\"address1\" maxlength=\"100\" class=\"cust_form\" value=\"\" />";} 

    echo "</td></tr><tr><td align=\"right\"><font class=\"body_text\">"; 

    if ($label_address2 == '---HIDE---') 
     {echo " </td><td align=\"left\"><input type=\"hidden\" name=\"address2\" id=\"address2\" value=\"\" />";} 
    else 
     {echo "$label_address2: </td><td align=\"left\"><font class=\"body_text\"><input type=\"text\" size=\"20\" name=\"address2\" id=\"address2\" maxlength=\"100\" class=\"cust_form\" value=\"\" />";} 

    echo "</td><td align=\"right\"><font class=\"body_text\">"; 

    if ($label_address3 == '---HIDE---') 
     {echo " </td><td align=\"left\" colspan=\"3\"><input type=\"hidden\" name=\"address3\" id=\"address3\" value=\"\" />";} 
    else 
     {echo "$label_address3: </td><td align=\"left\" colspan=\"3\"><font class=\"body_text\"><input type=\"text\" size=\"45\" name=\"address3\" id=\"address3\" maxlength=\"100\" class=\"cust_form\" value=\"\" />";} 

    echo "</td></tr><tr><td align=\"right\"><font class=\"body_text\">"; 

    if ($label_city == '---HIDE---') 
     {echo " </td><td align=\"left\"><input type=\"hidden\" name=\"city\" id=\"city\" value=\"\" />";} 
    else 
     {echo "$label_city: </td><td align=\"left\"><font class=\"body_text\"><input type=\"text\" size=\"20\" name=\"city\" id=\"city\" maxlength=\"50\" class=\"cust_form\" value=\"\" />";} 

    echo "</td><td align=\"right\"><font class=\"body_text\">"; 

請問,有什麼建議嗎?

+0

我相信只有Visual Studio允許ppl可視化地編輯網頁表單和網頁。看起來像一個'不行!'爲php – jondinham 2012-02-20 08:20:57

+0

編輯一切'視覺',也許你可以試試這個:http://www.jcxsoftware.com/jcx/vsphp/home – jondinham 2012-02-20 08:24:49

回答

0

您可能使用數據庫來存儲數據庫中的值,將sql語句添加到當前的php文件以獲取數據庫中的值。您還可以實現編輯頁面,該編輯頁面將允許客戶端編輯數據庫中的值。

+0

數據庫已經在使用,不包括因爲我認爲它看起來很複雜。我知道如何更改標籤,刪除和bt我的客戶沒有PHP編碼的經驗,但希望自己做,視覺 $ stmt =「SELECT label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_vendor_lead_code,label_gender,label_phone_number,來自system_settings;「; $ rslt = mysql_query($ stmt,$ link); $ row = mysql_fetch_row($ rslt); 如果(strlen的($行[0])> 0)\t {$ LABEL_TITLE = $行[0];} \t \t \t \t 如果(strlen的($行[4])> 0)\t {$ label_address1 = \t \t \t ### END找到任何自定義字段標籤### – 2012-02-20 08:45:49