Hi,
Do you find working on code written by other developer difficult like me?
I am working on this website in PHP.
It was given to me almost 80% complete (so they said) & needed to add new functionality like when membership expires send automatic e-mail or don’t allow user to login after membership expires. It had few bugs also like search doesn’t return correct result.
I have dought about basic structure of website. This website have one folder of all html pages with tags in each page like
<search_location_box size=”5″ name=”searchloc”>
<dbtable name=”MyDB” idfield=”jsid”>
<redir url=”thanks.php”>
<postemail emailfield=”email” template=”templates/email_new.txt”>.
etc etc… & there are all php function in /library/ folder which read these html templates & replaces tags with text boxes & database name.
Function like LoadTemplate(xyz.html);
remove_tag( …. );
Even database sql are created on fly not only INSERT but UPDATE is also done on fly, I don’t see any written sql statement:
function GetNewSaveSQL() // this function creates sql statement
{
global $tableinfo; //populated at top of this page
$sql = “insert into ” . $tableinfo->GetName() . ” (“;
$commaflag = false;
foreach ($tableinfo->fields as $fieldname => $field) {
if (! empty($_POST[$fieldname])) {
if ($commaflag == true) {$sql .= “, “;} else {$commaflag = true;}
$sql .= $fieldname;
}
}
$sql .= “) values (“;
$commaflag = false;
foreach ($tableinfo->fields as $fieldname => $field) {
if (! empty($_POST[$fieldname])) {
…………….
Is there any methodology this old developer has used or is it just bad development? Is it me who is not following it? Should I completely redo this project?