Jump to content

willingtolearn

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Everything posted by willingtolearn

  1. if i could kiss u i would thank u thank u thank u !!
  2. thanks so much for replying - i really really appreciate it!! well, my head is exploding.. it doesn't work:-( i keep getting an error : Parse error: syntax error, unexpected '<' in /home/morairal/public_html/rentals/details100.php on line 219 which is: <?php if (file_exists("../smallphotos/".$photo7.".jpg")) { ?> the page link is http://www.morairaluxuryvillas.com/rentals/details100.php?id=45 <? $query = "SELECT photo_name FROM photos WHERE PID=$id ORDER BY photo_name ASC LIMIT 4, 1"; $photos = mysql_query($query) or die ("Select Failed!"); $photo7 = mysql_fetch_array($photos); $photo7 = $photo7['photo_name']; <?php if (file_exists("../smallphotos/".$photo7.".jpg")) { ?> <a href="../smallphotos/<? echo $photo7; ?>.jpg" rel="lightbox[Villas]" > <img src="../smallphotos/<? echo $photo7; ?>.jpg" width="280" height="210" border="1"> </a> <?php } ?>
  3. hello - i am working on a script that someone else has created and need to add the option for more images to be displayed - only if there is any.. the script is the same for all images 1-6, I have copied and pasted for the additional images but i only want them to display only if there is any added... how do i edit the below code to show this I am new to php, so please be kind - any help you can give would be greatly appreciated. ?> $query = "SELECT photo_name FROM photos WHERE PID=$id ORDER BY photo_name ASC LIMIT 5, 1"; $photos = mysql_query($query) or die ("Select Failed!"); $photo6 = mysql_fetch_array($photos); $photo6 = $photo6['photo_name']; ?> <a href="../smallphotos/<? echo $photo6; ?>.jpg" rel="lightbox[Villas]" > <img src="../smallphotos/<? echo $photo6; ?>.jpg" width="280" height="210" border="1"> </a>
  4. Hello - I have a form detailing info on a property, and i would like to add an image upload for multiple images, where it stores the image in a folder and the file name in a table - I have no clue what I am doing and totally new to php so please excuse my ignorance.. I have two tables, one for storing all the property details and the other for storing the files (this one has 13 columns, PropertyID, Photo1, Photo 2, and so on to Photo12).. I have found the following script for storing one image, and have tried to alter to add extra (I need to store 12 images) but it keeps failing - can anyone help I am losing it big time? form - <form enctype="multipart/form-data" action="add.php" method="POST"> Name: <input type="text" name="name"><br> E-mail: <input type="text" name = "email"><br> Phone: <input type="text" name = "phone"><br> Photo: <input type="file" name="photo"><br> <input type="submit" value="Add"> </form> add.php - <?php //This is the directory where images will be saved $target = "images/"; $target = $target . basename( $_FILES['photo']['name']); //This gets all the other information from the form $name=$_POST['name']; $email=$_POST['email']; $phone=$_POST['phone']; $pic=($_FILES['photo']['name']); // Connects to your Database mysql_connect("your.hostaddress.com", "username", "password") or die(mysql_error()) ; mysql_select_db("Database_Name") or die(mysql_error()) ; //Writes the information to the database mysql_query("INSERT INTO `employees` VALUES ('$name', '$email', '$phone', '$pic')") ; //Writes the photo to the server if(move_uploaded_file($_FILES['photo']['tmp_name'], $target)) { //Tells you if its all ok echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded, and your information has been added to the directory"; } else { //Gives and error if its not echo "Sorry, there was a problem uploading your file."; } ?> thanks for your time:-)
  5. Hi - thanks for your help, but it is fixed now, I think it was because she hadn't filled in all the property details for the top property and fields were left blank, once I deleted it, the error disappeared.
  6. Hi thanks for the reply - i have attached the code, you were right with your guess, I am trying to figure out what $block1 is... It is a property site and she inserts the property details in through her admin section, this page lists all of the properties and pulls a brief description of every property listed down the page.. Thanks again for your help:-) 17728_.php
  7. Hi, I'll be honest don't have a clue what I am doing but a friend asked me to look into her site, she gets the following error at the top of this page http://www.morairaluxuryvillas.com/rentals/villalist.php Warning: strpos() [function.strpos]: Offset not contained in string in /home/morairal/public_html/rentals/villalist.php on line 85 the code on the line 85 is: $secondfstemp = strpos($block1, ".", $firstfs); I am more than willing to look into but don't know where to start - anyone have any ideas? Thanks for your time:-)
×
×
  • 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.