EntropySink

Technical & Scientific => Programming => Topic started by: micah on October 24, 2012, 09:34:49 AM

Title: sometimes the stupid just hurts
Post by: micah on October 24, 2012, 09:34:49 AM
I'm working on fixing some issues on an old site that apparently my company built years before any of us worked here.  Everything about the programming on this site is FUBAR. I mean everything, from the logic of how pages are laid out to the repetative use of redundent code (on the same page no less.)  this morning, I stubmled across this little gem:

Code: [Select]
<?php
...
$mailing_city=$row['mailing_city'];
$mailing_cityOther=$row['mailing_cityOther'];
...
if(
$mailing_cityOther){
 print(
"".stripslashes($mailing_cityOther)."");
}else{
 if(
$mailing_cityOther){
  print(
"".stripslashes($mailing_cityOther)."");
 }else{
  print(
"".stripslashes($mailing_city)."");
 }
}

?>
Title: Re: sometimes the stupid just hurts
Post by: Mike on October 24, 2012, 10:03:42 AM
That's...... special
Title: Re: sometimes the stupid just hurts
Post by: Steve on October 24, 2012, 12:48:05 PM
well alrighty then