My client has a form which is php generated. He wants to edit it himself like how html forms are done, rename, move text boxes, add text boxes.
But unfortunately the programmer has designed it such that in place of the forms it just says <php>
. Client insists there must be some way to do this. Any ideas. I am currently working with Dreamweaver. Here is part of the code.
### 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 " <input type=\"hidden\" name=\"first_name\" id=\"first_name\" value=\"\" />";}
else
{echo " $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 " <input type=\"hidden\" name=\"middle_initial\" id=\"middle_initial\" value=\"\" />";}
else
{echo " $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 " <input type=\"hidden\" name=\"last_name\" id=\"last_name\" value=\"\" />";}
else
{echo " $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\">";
Please, any suggestions?
You might use a database to store the values there, add sql statements to your current php file to get the values from the database. You can also implement an edit page which will allow the client to edit the values in the database.