echo "using echo sucks!";
Submitted by phrax on Mon, 2004-11-22 15:25. Wonky CodeNicely formatted, easy to read, but oh so wrong. The switch
is bad enough but using all those echo
makes me so angry. I pity all pour souls that have to work with code like this.
<?php
if(@$_POST['vote'] == TRUE)
{
switch (@$_POST['bewertung'])
{
case "1":
$punkt = 1;
break;
case "2":
$punkt = 2;
break;
case "3":
$punkt = 3;
break;
case "4":
$punkt = 4;
break;
case "5":
$punkt = 5;
break;
case "6":
$punkt = 6;
break;
case "7":
$punkt = 7;
break;
case "8":
$punkt = 8;
break;
case "9":
$punkt = 9;
break;
case "10":
$punkt = 10;
break;
}
mysql_query("INSERT INTO bewertung(repID,punkte) VALUES ('$repID','$punkt')");
}
/* hier kommt nur die Ausgabe der Puntkte nich relevant*/
echo "<table border=0 width=80 cellspacinng=0 cellpadding=0>";
echo " <tr>";
echo " <td>";
echo " <form method=\"post\" type=\"text/css\" action=\"http://www.example.com/index.php?section=Replays\">";
echo " <select name=\"bewertung\" size=\"1\">";
for ($bew = 1 ; $bew <= 10 ; $bew++)
{
echo "<option>".$bew."</option>";
}
echo " </td>";
echo " <td>";
echo " <input type=\"submit\" value=\"Vote\" name=\"vote\">";
echo " </form>";
echo " </td>";
echo " </tr>";
echo "</table>";
?>
Error! You have used up your lifetime quota of tabs.
Submitted by phrax on Thu, 2004-11-18 15:23. Wonky CodeDo you have a co-worker that writes perfectly formatted and meticulous code that is easy to read? This submitter doesn't. This code was written by his supervisor. Comments in code are submitters.
Personal Note: I had to work on some nasty code that put me in a foul mood today. However this cheered me up. I just have to keep repeating, "it can always get worse. It can always get worse!".