/*
This is a simple php photo album system, including the following files
Conn. php database tutorial connection file and file upload function and paging function
Vc. php used to display album
Files. php photo upload file
Index. php photo album Management Code
Savefile. php save the file code
*/
?>
Index. php
The code is as follows: |
Copy code |
<! Doctype html public "-// w3c // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <Html xmlns = "http://www.111cn.net/1999/xhtml"> <Head> <Meta http-equiv = "content-type" content = "text/html; charset = gb2312"/> <Title> Untitled Document </title> <Link href = "config/csstutorial .css" rel = "stylesheet" type = "text/css"/> </Head> <Body> Photo Album & nbsp; <a href = "files. php"> Added </a> <br/> <Hr color = "# ff0000" align = "left" size = "1" width = "80%"/> <Table border = "0" cellspacing = "1" cellpadding = "1" bgcolor = "# cccccc"> <tr> <? Php Require_once ("config/conn. php "); $ SQL = "select * from images order by imid "; $ Result = page ($ SQL, 16 ); $ I = 1; While ($ row = mysql tutorial _ fetch_assoc ($ result [0]) { ?> <Td width = "120" height = "150" align = "center" valign = "middle" bgcolor = "# ffffff"> <A href = "<? = "File/". $ row ["imname"]?> "Target =" _ blank "> "Alt =" <? = $ Row ["imtitle"];?> "Border =" 0 "/> </a> </td> <? If ($ I % 4 = 0) echo "</tr> <tr> "; $ I ++; } ?> </Tr> </Table> <? Php echo $ result [1];?> </Body> </Html>
|