Jump to content

admin2gd1

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

admin2gd1's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have been creating a upload form for images that creates a thumbnail and a resized image and placing them in to seperate locations. I have succesfully done this for 1 image without inserting the image into a database. Now I am trying to upload 12 images and resize at the same time and insert them into the database where it updates the rows where the photo goes. So I have these following errors that I have not managed to get round to work. 1. The photos I do not think are being picked up from the form correctly for each image. 2. The images will not create a thumbnail for each image. 3. The process thinks that the image is not valid even if the first 2 errors were actually working. 4. Because of error 1, 2 and 3 the photo is uploading into the directories for each image and type (original, resized and thumbnail) 5. Because of the first 4 errors, it doesn't update the database for the ID number in the table specified for the date for last edit. I have uploaded the first stage with just a basic form to create the images and the 2 seperated pages for creating the images and adding them to the database. If I can have some help on correct these errors I would really appreciate it. Thank you. P.S. When the form checks if the file size has gone over the limit, the image files are still uploaded to the directories specified so that needs fixing also. [attachment deleted by admin]
  2. I am trying to update the amount of postings remaining down everytime a user posts so if the user had a limit of 200 posts then when the user posts it counts down by 1 and updates the table field for that user to 199. Now the error that I am getting is that it does not count down correctly and puts 20 instead and then the next time the user posts after that it will put 0. $remain = mysql_query("SELECT postings_remaining FROM ".TBL_USERS." WHERE username = '$session->username' limit 1"); $postings = $remain; //Count the number of postings remaining the user has $postingsremain = $postings - 1; //Remove 1 to the users posting remainings $sqlcountdown = mysql_query("UPDATE ".TBL_USERS." SET postings_remaining = '$postingsremain' WHERE username = '$session->username'"); If someone can help me with this function I would very much appreciate it.
  3. Here is something quick someone can help me with. I can't get the second image to show. If the photo in the database and directory doesn't exist then show image 2 but it's not doing it because it is still trying to read from the directory where the photos would be, so it ignores the second image in less that directory does not exist also. Now the thing is I have 12 photos all together in one directory and the directory needs to exist for the other 11 photos so what I want is the second image to show and not try to read from the directory. This is my code that I am using, don't worry about $SITEurl and $username and $name they are working. <?php if(file_exists("../photos/properties/$username/$name/$photo1")){ ?> <img class="photo" src="<?php echo $SITEurl ?>/photos/properties/<?php echo $username; ?>/<?php echo $name; ?>/<?php echo $photo1; ?>" alt=""> <?php }else{ ?><img class="photo" src="<?php echo $SITEurl; ?>/images/<?php echo getLang(noimage); ?>" alt=""><?php } ?>
  4. I need some help with 2 functions here. I had trouble getting any of it working before but I have manage to make several corrections but I still need help with 2 things. 1. I can't delete the photo file from database until my check is corrected as it will not go passed it to continue the code. 2. If I don't have my check code inserted I can delete the file perfectly well from the database but can not get it to delete the file from the directory the photo was uploaded too. Here is my latest code. <?php if($_GET['mode'] == "delete_photo"){ if (isset($_GET['photo'])) { $photo = (int) $_GET['photo']; } else { $photo = false; } if (($photo === false) || ($photo < 1) || ($photo > 12)) { $msg = "Error: photo number not specified or out of range!"; } ///// Checks if any Photo has been Removed Already or not been Uploaded Before ///// $check = "SELECT photo".$_GET['photo']." FROM ".TBL_PROPERTIES." WHERE property_id='".$_GET['id']."' AND username='$session->username' "; if(@mysql_query($check)){ if ($check == $empty){ $msg3 = "Photo ".$_GET['photo']." has either already been removed or no photo was uploaded before."; }else{ $msg3 = "ERROR: There seems to be a problem, please contact administrators for help at " . ADMIN_EMAIL . " !"; } }else{ ///// Remove Photos from Directory and DB ///// $get_file = mysql_query("SELECT photo".$_GET['photo']." FROM ".TBL_PROPERTIES." WHERE property_id='".$_GET['id']."' AND username='$session->username' AND name='$name' ") or die ( mysql_error() ); list($del_path) = mysql_fetch_row($get_file); @unlink("$SITEurl/photos/properties/{$session->username}/$name/$del_path"); $deletefile = mysql_query("DELETE photo".$_GET['photo']." FROM ".TBL_PROPERTIES." WHERE property_id='".$_GET['id']."' "); if(@mysql_query($deletefile)){ $msg2 = "Photo <b>".$_GET['photo']."</b> has been deleted!"; }else{ $msg2 = "ERROR: Theres a problem deleting <b>photo ".$_GET['photo']."</b> from your property photo directory, please contact administrators for help at " . ADMIN_EMAIL . " !"; } $sql = mysql_query("DELETE FROM ".TBL_PROPERTIES." WHERE property_id='".$_GET['id']."' AND photo".$_GET['photo']."='$photo' ") or die ( mysql_error() ); $lastedit = date("Y:m:d H:i:s"); $sqlUPDATE = "UPDATE ".TBL_PROPERTIES." SET photo".$_GET['photo']."='', last_edit='$lastedit' WHERE property_id='".$_GET['id']."' "; if(@mysql_query($sqlUPDATE)){ $msg = "You have removed <b>photo ".$_GET['photo']."</b> from your property!"; }else{ $msg = "ERROR: Theres a problem removing photo ".$_GET['photo'].", please contact administrators for help at " . ADMIN_EMAIL . " !"; } } } ?> If I can get some help to fix those 2 problems that would be great.
  5. I am having a tiny problem getting my search results for my properties. I can't seem to get any results for any input I choose. I have done a thorough test on my search page and these are the things that are not working. When searching for properties, the results say how many there are but don't display just those properties the user searched for. For e.g. you search for a property and one of the values does not match any of the properties it will decide not to tell you how many properties found for any of the other values you searched for. So for e.g. if you searched for 2 bedrooms 1 bathroom and a pool, and there were either 1 or more properties with 2 bedrooms 1 bathroom and no pool, It will say no properties found. When a property is found even if it's one, it still fills the page with at least 10 properties and not the one it found. It should only show the properties found and not just refresh the page. I have uploaded the files that should help any one to help me get this search page fixed. If any one can have a look at this and correct these errors, I would really appreciate it. Thank you. [attachment deleted by admin]
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.