DH Templates

If you have maintained others code / done complete e-business website, I need advice.?

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 tage 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( .... ); replace_tag($tagname, $replacewith, $text) Please see more details 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?

Public Comments

  1. I've been a web developer for about 8 years. I've single-handedly designed everything from small sites to sites ranked among the top 30,000 on the Internet. During this time I've had a few occasions to work with code that another developer created and I was asked to maintain/update. To be honest, unless the developer did a fairly decent job of commenting and/or documenting his code, it may take you so long to familiarize yourself with his methods that it will end up being easier, and BETTER in the long run to redesign the entire thing yourself. However, depending on the budget your client has to work with and the size of the overall site, it might not be feasible to actually redesign the entire project. In this case, you're basically stuck tracing the execution path from start to finish to get a good handle on how things are done. You will probably find that whatever the developer does on one page, he will also do on the rest of his pages. So once you discover that initial method, the rest will go much faster and easier. Judging by the small amount of code you posted, it looks like he's using an SQL creation function to save himself the trouble of having to write an SQL query for each form on the site. He's using a class object which must be instantiated based on whatever table is determined to be the relevant table for this query. That table appears to be defined at the top of the code of the various pages. I wish I could provide more detail, but there isn't enough code here for me to perform any deeper analysis. Best of luck my friend!
Powered by Yahoo! Answers