The Daily WTF: Curious Perversions in Information Technology
Welcome to TDWTF Forums Sign in | Join | Help
in Search

More fun from the world of Bad Classic ASP

Last post 02-11-2008 5:17 PM by ObiWayneKenobi. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 02-11-2008 5:17 PM

    More fun from the world of Bad Classic ASP

    Here's an interesting snippet from a mass mail tool that reads in an Excel spreadsheet that needs to be uploaded to the web server prior to using it (That's not the WTF - it actually makes sense because the manager can target specific subsets of customers, instead of all of them):

    action = request.querystring("a")
    if request.QueryString("fn")<>"" then
         fn=request.QueryString("fn")
    end if

    select case action
        case 1
            FileUploaded("File Uploaded")
        case 2
            FileUploaded("File Uploaded")
        case else
            FileUploaded("File Uploaded")
    end select

    The function "File Uploaded" A) Doesn't use the variable that it's passed at all, and B) includes a whole HTML form within its declaration, like so:

    <% Function FileUploaded(str) %>
        <b><font size=2>Mass Mail Tool</font></b>
    <form enctype="multipart/form-data" action="wtf_massMail_tool.asp?a=1" name="form" onSubmit="return validate(document.form)">
    <table>
      <tr>
        <th>Step 1: Upload File</th>
    <!-- snip - other HTML -->
    <% End Function %>

    Is this supposed to be some kind of poor man's Model View Controller (not that I think the original developer knew what M-V-C was to begin with)?  The funniest part, though, is that the tool REQUIRES you to split the HTML up for the mail message into two text areas, so that it can inject the recipient's name into the body of the message.  Otherwise, it won't work properly (or just not show the person's name).

    The Daily WTF Forums. You will never find a more wretched hive of scum and villainy.
Page 1 of 1 (1 items)
Powered by Community Server (Non-Commercial Edition), by Telligent Systems