All pastes #231609 Raw Edit

Untitled

public php v1 · immutable
#231609 ·published 2006-10-31 22:22 UTC
rendered paste body
<style>x { cursor: pointer; }</style><body><?	$pageid = (int) $_GET['pageid'];	if($pageid>20 || $pageid<1)	$pageid=1;	$per_page = 9;	$start = ($pageid-1) * $per_page;	$total_num = "30";?><table align=center border=1>	<tr>		<td  valign=top>			<table align=center cellpadding=0 cellspacing=15 background=images/gbg.gif>			<tr>				<td colspan=3 valign=top align=center>					<form>						<?php 							echo"								<select id=galid onChange=\"go()\" class=input style=\"width: 								150px;background-color: orange;text-align: right;\">								<option value=null name=null"; if($_GET['galid'] == "null") { 								echo"selected=selected"; } echo">&#1489;&#1495;&#1512; &#1511;&#1496;&#1490;&#1493;&#1512;&#1497;&#1492;</option>";								$result = mysql_query("SELECT * FROM `gallery` ORDER BY `id` ASC");								for ($i=1; $row=mysql_fetch_array($result); $i++) {								$name=$row['name'];								$galid=$row['galid'];								echo"								<option value=\"$galid\" name=\"$galid\""; if($_GET['galid'] == "$galid") 								{ echo"selected=selected"; } 								echo">&nbsp;&nbsp;".$name."&nbsp;&middot;</option>";}							echo"								</select>					</form>				</td>			</tr>	<tr>";	if($_GET['galid'] != "null") {		$i=0;			foreach (glob("gallery/$galid/*.{jpg,png,gif}", GLOB_BRACE) as $filename) {				if($i>($_GET['pageid'] * 12))	{					if($i<($_GET['pageid'] * 12 + 12)) {						if($i % 3== 0) {echo "<tr>";}						echo"						<td class=border>						<x><img src=\"$filename\" onclick=\"changeImage('$filename')\" width=75 height=75 						style=\"cursor: pointer;\"></x>						</td>";						if ($i % 3 == 2) { echo"</tr>";} 								              }						$i++;							  }										}			       }			echo"				</table>				</td>				<td valign=top>				<img name=mainimage src=".$filename." class=border height=445 width=400 valign=middle>				</td>	</tr></table>		<div align=center class=regular>";			$num_pages = ceil($total_num / $per_page);			for ($i = 1; $i <= $num_pages; $i++) 				{ 			if($pageid-$i == 0) {$mark="";} else {$mark="-";}			if($i != $num_pages) { $mark="-"; } else { $mark=""; }       			if ($pageid == $i) { echo"$i&nbsp;$mark";} 				elseif($pageid != $i) 					{			echo "			".$mark."&nbsp;			<a href=\"index.php?page=gallery&galid=".$galid."&pageid=".$i."\" class=regular>".$i."</a>"; 					}				}			?>		</div></body>