All pastes #90656 Raw Edit

Something

public php v1 · immutable
#90656 ·published 2006-07-17 22:03 UTC
rendered paste body
<?PHP session_start(); require("access.php"); ?><?php include("top2.php"); ?><?phpif(isset($_POST['submit'])) { $title2 = $_POST['title'];$title = strip_tags($title2);$description2 = $_POST['description'];$descripton = strip_tags($description2);$image_name2 = $_POST['image_name'];$image_name = strip_tags($image_name2);$year = date("Y");$month = date("m");$day = date("d");$hours2 = date("H");if ($hours2 == "00") {$hours = "10";}elseif ($hours2 == "01") {$hours = "11";}elseif ($hours2 == "02") {$hours = "00";}else {$hours = $hours2;};$time = date("$hours:i");$short_titleCheck = @mysql_query('Select Count(short_title) as Num From gallery Where short_title="'.$_POST[short_title].'"');    if (!$short_titleCheck) {    die ('Error Performing Query: ' . mysql_error() . '</p>');    }   $row = mysql_fetch_array($userlogin);   $Count = $row['Num'];     if ($Count >= "1") { include_once ('top.php');?> This Photo Name is already in use, please g <a href="javascript: history.go(-1)">back</a> and choose another Photo Name. <?php include ('bottom2.php'); exit; }if ( eregi('^image/p?jpeg(;.*)?$',       $_FILES['UPFIELD']['type'])  )       $extension = '.jpg';       else $extension = '.gif';        $Img =   $image_name. $extension; $imgdir = "/home/gerbitzo/public_html/gallery_images/"; $imgfile = "http://www.gerbitz.org/gallery_images/".$Img;   if (is_uploaded_file($_FILES['UPFIELD']['tmp_name']) and copy($_FILES['UPFIELD']['tmp_name'], $imgdir . $Img)) {   echo("<p>Uploading your image as $Img.<P>"); } else { echo("<p>Could Not Save file as $Img<P>"); } $photo = $imgfile;mysql_query("insert into gallery(owner,gerbitz_id, short_title, title, description, image_loc, day, month, year, active) values('$_SESSION[FullName]', '$_SESSION[UserName]',  '$image_name', '$title', '$description', '$photo', '$day', '$month', '$year', '0')") or die("Error - couldn't insert data into database<br><br>" . mysql_error());echo "Uploading your images now... Please Wait..... ";echo "<META HTTP-EQUIV=\"refresh\" content=\"2;URL=gallery_upload.php\">";} else {function gethint($name) { 	$q = mysql_query("SELECT Setting_Value from settings WHERE Setting_Name = '$name' LIMIT 0,1");	$r = mysql_fetch_row($q);	return $r[0];}?><center>   <strong>Select your image that you would like to add to your gallery. </strong><br></center><form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" enctype="multipart/form-data">  <table>  <tr>    <td><strong>Photo Name </strong>      <div align="center"></div></td>    <td><a href="" onMouseOver="return escape(' <?php echo gethint('hint_photo_upload'); ?> ')"><img width="15" alt="" src="images/small_help.gif" hspace="3" height="15" border="0"></a></td>    <td><input name="image_name" type="text" size="45"></td>  </tr>  <tr>    <td><div align="center"><strong>Title</strong></div></td>    <td><a href="" onMouseOver="return escape(' <?php echo gethint('hint_photo_upload'); ?> ')"><img width="15" alt="" src="images/small_help.gif" hspace="3" height="15" border="0"></a></td>    <td><input name="title" type="text" size="45"></td>  </tr>  <tr>    <td><div align="center">      <p><strong>Description</strong></p>      </div></td>    <td><a href="" onMouseOver="return escape(' <?php echo gethint('hint_photo_upload'); ?> ')"><img width="15" alt="" src="images/small_help.gif" hspace="3" height="15" border="0"></a></td>    <td><textarea name="description" cols="45" rows="8"></textarea></td>  </tr>  <tr>    <td><div align="center">      <p><strong>Photo</strong></p>      </div></td>    <td><a href="" onMouseOver="return escape(' <?php echo gethint('hint_photo_upload'); ?> ')"><img width="15" alt="" src="images/small_help.gif" hspace="3" height="15" border="0"></a></td>    <td><p>        <input name="UPFIELD" type="file" size="35">    </p></td>  </tr>	<tr> 		<td><center><input type="submit" name="submit" value="Submit"></center><td>	 </tr></table></form><?php}?><?php include("bottom2.php"); ?>