File: php1.php

package info (click to toggle)
ohcount 3.0.0-6.1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 4,828 kB
  • sloc: ansic: 6,534; ruby: 2,560; perl: 2,041; erlang: 350; lisp: 272; sh: 244; pascal: 196; vhdl: 150; haskell: 149; asm: 127; cs: 124; awk: 98; java: 92; php: 73; tcl: 58; xml: 57; fortran: 54; makefile: 32; python: 31; ada: 30; objc: 30; jsp: 28; sql: 18; cobol: 13; ml: 9; cpp: 3
file content (59 lines) | stat: -rw-r--r-- 1,806 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
html	code	<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
html	code	                      "http://www.w3.org/TR/html4/strict.dtd">
html	code	<html>
html	code		<head>
html	code			<script type="text/javascript">
javascript	comment			// javascript comment
javascript	code			document.write("Hello World!")
html	code			</script>
html	code			<style type="text/css">
css	comment			/* css comment */
css	code			h1 {
css	code				color: black;
css	code			}
html	code			</style>
html	code		</head>
html	code		<body>
html	code		<table cellSpacing=1 cellPadding=2 bgColor=black border=0>
html	code		<tr bgColor=white>
html	code		<td>First</td>
html	code		<td>Last</td>
html	code		<td>Email<td>
html	code		</tr>
html	code		</table>
html	blank	
html	code	<?
php	comment	## Comment with a hash symbol ##
php	code		mysql_connect("localhost", "db user", "db pass")
php	code		or die("DB CONNECT ERROR: " . mysql_error());
php	blank	
php	code		mysql_select_db("db name")
php	code		or die("DB SELECT ERROR: " . mysql_error());
php	blank	
php	code		$query = "SELECT fname, lname, email FROM table ORDER BY lname";
php	blank	
php	code		$result = mysql_query($query)
php	code		or die("DB SELECT ERROR: " . mysql_error());
php	blank	
php	code		while($row = mysql_fetch_array($result))
php	code		{
php	code			$lname = $row['lname'];
php	code			$fname = $row['fname'];
php	code			$email = $row['email'];
php	blank	
php	comment			// Spaghetti code starts....(slopping html code in)
html	code	?>
html	blank	
html	code		<tr bgColor=white>
php	code		<td><?=$fname?></td>
php	code		<td><?=$lname?></td>
php	code		<td><?=$email?><td>
html	code		</tr>
html	code		</table>
html	blank	
html	code	<?
php	code		} // end while
php	comment		// Spaghetti code is both a source of praise and complaints
html	code	?>
html	blank	
html	code	</body>