OTWO-1213 Works around lost encoding in Ruby/C binding layer
[ohcount] / test / src_dir / php1.php
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
2                       "http://www.w3.org/TR/html4/strict.dtd">
3 <html>
4         <head>
5                 <script type="text/javascript">
6                 // javascript comment
7                 document.write("Hello World!")
8                 </script>
9                 <style type="text/css">
10                 /* css comment */
11                 h1 {
12                         color: black;
13                 }
14                 </style>
15         </head>
16         <body>
17         <table cellSpacing=1 cellPadding=2 bgColor=black border=0>
18         <tr bgColor=white>
19         <td>First</td>
20         <td>Last</td>
21         <td>Email<td>
22         </tr>
23         </table>
24
25 <?
26 ## Comment with a hash symbol ##
27         mysql_connect("localhost", "db user", "db pass")
28         or die("DB CONNECT ERROR: " . mysql_error());
29
30         mysql_select_db("db name")
31         or die("DB SELECT ERROR: " . mysql_error());
32
33         $query = "SELECT fname, lname, email FROM table ORDER BY lname";
34
35         $result = mysql_query($query)
36         or die("DB SELECT ERROR: " . mysql_error());
37
38         while($row = mysql_fetch_array($result))
39         {
40                 $lname = $row['lname'];
41                 $fname = $row['fname'];
42                 $email = $row['email'];
43
44                 // Spaghetti code starts....(slopping html code in)
45 ?>
46
47         <tr bgColor=white>
48         <td><?=$fname?></td>
49         <td><?=$lname?></td>
50         <td><?=$email?><td>
51         </tr>
52         </table>
53
54 <?
55         } // end while
56         // Spaghetti code is both a source of praise and complaints
57 ?>
58
59 </body>