Last active
August 1, 2019 13:22
-
-
Save JohnMGant/e317c5f795ab2e55d7b32095c737f04d to your computer and use it in GitHub Desktop.
Example of classic ASP spaghetti code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <body> | |
| <table> | |
| <% | |
| set conn=Server.CreateObject("ADODB.Connection") | |
| conn.Provider="Microsoft SQL Server" | |
| conn.Open "Server=SQLPROD;Database=HR;UserID=SuperDuperAdmin;Password=ABC123!!!" | |
| set rs=Server.CreateObject("ADODB.recordset") | |
| sql="SELECT ID, Name, FavoriteColor " & | |
| "FROM Employees " & | |
| "WHERE LastName LIKE '" & Request.QueryString("lastName") & "%' " & | |
| "ORDER BY LastName, FirstName" | |
| rs.Open sql, conn | |
| %> | |
| <tr><th>ID</th><th>Name</th><th>Favorite Color</th></tr> | |
| <%do until rs.EOF%> | |
| <tr><td>rs!ID</td><td>rs!Name</td><td>rs!FavoriteColor</td></tr> | |
| <%loop%> | |
| </table> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment