All pastes #960482 Raw Edit

Unnamed

public php v1 · immutable
#960482 ·published 2008-03-28 04:07 UTC
rendered paste body
<?session_start();if(!session_is_registered(myusername)){header("location:index.php");}$last_id = $_POST['last_id'];?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Auction Interactive Group</title><script type="text/javascript" src="../test.js"></script><script type="text/javascript" src="js/jquery.js"></script><script type="text/javascript" src="js/jquery.lightbox-0.4.js"></script><link rel="stylesheet" type="text/css" href="css/jquery.lightbox-0.4.css" media="screen" /><link rel="Stylesheet" type="text/css" href="../main.css" /><link rel="Stylesheet" type="text/css" href="../form.css" /><link rel="Stylesheet" type="text/css" href="../popup.css" /><script src="../dw_viewport.js" type="text/javascript"></script><script src="../popup.js" type="text/javascript"></script> <script type="text/javascript">    $(function() {        $('#thumbs a').lightBox();    });    </script><?PHP$userid = $_SESSION['uid'];$userInfo = explode(';', $_SERVER['HTTP_USER_AGENT']);include '../menu.php';include 'db.php';include 'imgFunction.php';if ($userInfo[1] == " U") {echo "<style type=\"text/css\"><!--#top {background-image: url(../images/top.png);width: 876px;height: 99px;}#topmid {background-image: url(../images/topmid.png);width: 876px;height: 89px;}//--></style>";}if ($userInfo[1] == " MSIE 7.0"){echo "<style type=\"text/css\"><!--#top {background-image: url(../images/top.png);width: 876px;height: 99px;}#topmid {background-image: url(../images/topmid.png);width: 876px;height: 89px;}//--></style>";}if ($userInfo[1] == " MSIE 6.0"){echo "<style type=\"text/css\"><!--#top {background-image: url(../images/top.gif);width: 876px;height: 99px;}#topmid {background-image: url(../images/topmid.gif);width: 876px;height: 89px;}//--></style>";}else{echo "<style type=\"text/css\"><!--#top {background-image: url(../images/top.png);width: 876px;height: 99px;}#topmid {background-image: url(../images/topmid.png);width: 876px;height: 89px;}//--></style>";}?></head><body><div id="main">    <div id="bodydiv">        <div id="top"></div>        <div id="topmid">            <div id="navcont"> 						<? echo "$topbuttonshome";?>            </div>        </div>        <div id="mid">            <div id="midcont">                <div id="howitworks">                    <div id="howittext">                        <table width="160" border="0" cellspacing="0" cellpadding="4">                            <tr>                                <td colspan="2">Use the tutorial, view the demo or email us your questions to get the best out of it!<br />                                    <br />                                    <br /></td>                            </tr>                            <tr>                                <td width="38"><img src="../images/key.png" width="25" height="30"  alt="key"/></td>                                <td width="122"><div style="padding-left: 16px; padding-top: 2px;"><span class="mainnav"><a href="#">Click Here!</a></span></div></td>                            </tr>                        </table>                    </div>                </div>            </div>        </div>				<? echo "$buttons"; ?>        <div id="content">            <div class="contall">                <div class="conttop"></div>                <div class="contmid">                    <div class="subcontent">                      <img src="images/add_property4.gif" alt="register" /><br />		<div class="title"><? echo "$agentnavigation"; ?>		</div><br /><br /> 		<div id="formleft">        <div id="thumbs"><ul><?if(isset($_POST['upload'])){     		$description = $_POST['description'];		$fileName = $_FILES['userfile']['name'];		$tmpName  = $_FILES['userfile']['tmp_name'];		$fileSize = $_FILES['userfile']['size'];		$fileType = $_FILES['userfile']['type'];     				dbConnect('EMeLesson');		$dquery = "SELECT * FROM ai_property_images where `pid` = '$last_id'";		$dresult=mysql_query($dquery);		$dnum=mysql_numrows($dresult);		mysql_close();			if ($row = mysql_fetch_array($dresult)) {		echo "You have already uploaded an image, please replace the current image.<br /><br />";        }		else if ($fileType == "")		{		echo "<font color='red'>You have not selected an image.</font><br /><br />";		}		else {				$fp = fopen($tmpName, 'r');		$content = fread($fp, $fileSize);		$content = addslashes($content);		fclose($fp);				if(!get_magic_quotes_gpc())		{			$fileName = addslashes($fileName);		}				dbConnect('EMeLesson');		$query = "INSERT INTO ai_property_images ( `iid`, `description`, `name`, `size`, `type`, `content`, `pid` )		         VALUES ( NULL , '$description' ,'$fileName', '$fileSize', '$fileType', '$content', '$last_id' )";		mysql_query($query) or die('Error, query failed');							mysql_close();		}				dbConnect('EMeLesson');		$pquery = "SELECT * FROM ai_property_images where `pid` = '$last_id'";		$presult=mysql_query($pquery);		$pnum=mysql_numrows($presult);		mysql_close();				$x = 0; 		while ($x < $pnum){ 		$iid=mysql_result($presult,$x,"iid");		$desc=mysql_result($presult,$x,"description");		$newImgSize = newSize("view.php?id=$iid"."jpg", 90);?>		<li>            <a href="view.php?id=<? echo "$iid";?>" title="<? echo "$desc";?>">                <img src='view.php?id=<? echo "$iid";?>' alt='' width='<? echo "$newImgSize[0]";?>'  height='<? echo "$newImgSize[0]";?>' />            </a>        </li>        <?		$x++; 		} 		if ($fileType == "")		{		echo "";		}		else {		echo "</ul></div>		<div class='clearit'></div>		<br>File $fileName uploaded<br> press finish to end image upload procedure.<br><br>				";}}		else {echo "Please upload an image.";}?>  <table width="350" border="0" cellpadding="1" cellspacing="1" class="box">  <form action="" method="post" enctype="multipart/form-data" name="uploadform">    <tr>       <td width="246">            Description: <br>      <textarea name="description" cols="45" rows="5"></textarea><br>      <input type="hidden" name="last_id" value="<? echo "$last_id"; ?>" />      <input type="hidden" name="MAX_FILE_SIZE" value="2000000"><input name="userfile" type="file" class="box" id="userfile"><input name="upload" type="submit" class="box" id="upload" value="  Upload  "></form>      <form action="delfromup.php?iid=<? echo "$iid"; ?>&pid=<? echo "$pid"; ?>">      <input name="delete" type="submit" class="box" id="delete=" value=" Delete " /><br />      </form>      <form action="entry.php">      <br /><br /><input name="finish" type="submit" class="box" id="finish" value="Finish">      </form></td>    </tr>  </table>		</div>                    </div>                </div>                <div class="contbot"></div>            </div>            <br />        </div>        <div id="footer">            <div id="copyright">© Copyright Auction Interactive 2008. All Rights Reserved.</div>        </div>    </div></div><? echo "$menu"; ?></body></html>