Jump to content

php_beginner_83

Members
  • Posts

    89
  • Joined

  • Last visited

    Never

Everything posted by php_beginner_83

  1. Thanks fellas. I'll get working on those. I think the pic of the dog is gone. My brother told me about it. I thought I had it fixed before but it's hard for me to tell coz when I view the webpage the pics load pretty quickly but I'm gonna work on trying to make it faster. Thanks again. I really appreciate you taking the time to have a look and give me feedback
  2. Thanks for your feedback. What do you mean my breadcrumbs should go left to right?
  3. Hi All I'd be really grateful if you could have a look at my website and tell me what you think. And perhaps offer some suggestions on anything you think could be done better..which I'm sure there's plenty. This was my first ever website so please be gentle.. I've tried it out in firefox and IE6. Firefox should be fine..a couple of links are a bit higher than they should be in IE but I can't get them perfect. www.pictiuirshannagh.5gigs.net Thanks
  4. Hi All I've finished developing my first website. As I went along, I didn't view it in IE...I know I should of but forgot because I never use IE. At first, the photos I was displaying were in the correct place in both browsers but of course I didn't make the website to be viewed in 1024x768 screen resolution. So now I'm going through it resizing and rearranging to make this work. However, now the images that once displayed in the correct place in both browsers, don't. When it's in the correct place in Firefox, it's a good bit out of place in IE and vice versa. Can anyone help me fix this? This is driving me absolutely nuts. I can provide a link to the live website but I haven't uploaded any of my adjustments until I get it working on my local server. I'd really appreciate any help you can give. <?php session_start(); $placeValue = $_GET['place']; $width = $_GET['width']; include('connection.php'); $albumID = $_GET['ID']; //sql query to get records from that album. $result = mysql_query("SELECT Path AS PATH FROM pictures INNER JOIN pics_in_albums ON pictures.ID = pics_in_albums.PicID INNER JOIN albums ON pics_in_albums.AlbumID = albums.ID WHERE albums.ID = \"$albumID\" GROUP BY pictures.ID LIMIT 1") or die(mysql_error()); $counter = 0; $path = array(); //fetch tha data from the database while ($row = mysql_fetch_assoc($result)) { $path[$counter] = substr(strrchr($row['PATH'],92),1); } $img = imagecreatefromjpeg("images//" . $path[0]); $tempWidth = imagesx($img); if ($width == '75') { $background = "photoBackground.png"; $cssWidth = "600px"; $cssHeight = "490px"; $cssTop = "60px"; $cssLeft = "370px"; $posTop = "80px"; $posLeft = "24px"; } else if ($width == '67') { $background = "photoBackgroundPortrait.png"; $cssWidth = "490px"; $cssHeight = "560px"; $cssTop = "35px"; $cssLeft = "500px"; $posTop = "55px"; $posLeft = "3px"; } else if ($tempWidth == '456') { $background = "photoBackground.png"; $cssWidth = "600px"; $cssHeight = "490px"; $cssTop = "60px"; $cssLeft = "370px"; $posTop = "80px"; $posLeft = "24px"; } else if ($tempWidth == '342') { $background = "photoBackgroundPortrait.png"; $cssWidth = "490px"; $cssHeight = "560px"; $cssTop = "35px"; $cssLeft = "500px"; $posTop = "55px"; $posLeft = "3px"; } ?> <!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"> <?xml version="1.0" encoding="iso-8859-1"?> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> body { text-align:center; } #background { background: url(images/picsBackground.jpg) no-repeat; position:relative; margin-left:auto; margin-right:auto; /*margin-bottom:50px;*/ width: 1000px; height:630px; left:10px; top:-45px; border:solid 1px red; } #background h3 { font-family: "Trebuchet MS"; font-size:16px; } #photoBackground { /*background:url(images/photoBackground.png) no-repeat;*/ background-image:url(images/<?php echo $background; ?>); background-repeat: no-repeat; position:absolute; left:<?php echo $cssLeft; ?>; top:<?php echo $cssTop; ?>; width:<?php echo $cssWidth; ?>; height:<?php echo $cssHeight; ?>; } /* home link */ #link1 { position:relative; left:400px; top:-6px; border:0px; z-index:50; } /* places link */ #link2 { position:relative; top: -71px; left:275px; border:0px; z-index:50; } #link3 { position:relative; left: 150px; top:-101px; border:0px; z-index:50; } #sidebar { position:relative; top:-30px; float: left; left:30px; width: 300px; padding: 9px 0 0 5px; /*border:1px; border-style:solid background: #D1D8D1;*/ } #description { position:relative; top: -60px; margin-right:600px; left:100px; margin-bottom:-30px; } #border { border:1px #000000; border-style: solid; padding:2px 2px 2px 2px; } td.col1 { vertical-align:middle; padding: 2px 2px 2px 2px; text-align:center; /*border-bottom:solid 3px; border-right:solid thin; border-left:solid thin; border-top:solid thin;*/ } #sidebar img { border:0px; } #photoPosition { position:relative; top: <?php echo $posTop; ?>; left:<?php echo $posLeft; ?>; width:456px; border:0px; margin:0px; padding:0px; } #transparentPos { position:absolute; /*top: <?php // $posTop; ?>; left:<?php //echo $posLeft; ?>;*/ top: 0px; left: 0px; } #nextPrevLinks { position:absolute; top: 520px; height:50px; width:150px; margin-right:750px; margin-left:300px; left:570px; z-index:50; border:solid 1px red; } </style> </head> <body bgcolor="#000000"> <div id="link1"> <a href='polaroid_menu.php'><img src='images/home.png' border="0"></a></div> <div id="background"><br/><br/><br/><br/> <?php // back button to places page echo "<div id=link2><a href='polaroidPlaces1.php?place=$placeValue'><img src='images/places.png' border=0/></a></div>"; // back button to albums page echo "<div id=link3><a href=polaroidAlbums.php?page=photo&place=$placeValue><img src='images/albums.png' border=0></a></div>"; include('galleryCode.php'); ?> </div> </body> </html> This is the code that displays the photos...galleryCode.php.. echo "<div id=photoBackground>"; echo "<div id=photoPosition>"; echo "<img src=\"{$currentImage}\">"; echo "<div id=transparentPos>"; echo '<img src ="images/transparent.gif" width="' . $width . '" height="' . $height . '" border="0"/>'; echo '</div>'; echo "</div>"; Thank you.
  5. I'm sorry I probably should of also said that I change the background image using javascript and the background image is specified using css.
  6. Hi All I'm having a problem getting the background image of a <div> to stay. What I'm trying to do is when a user clicks on a thumbnail of an image a larger version of the thumbnail will be displayed on the same page. This works no problem. Depending on whether the image is landscape or portrait, I want to change the background image. It works but after a few seconds it goes back to the original background image. However, instead of having the link on an image(my thumbnails) when I put the code on text it works and the background sticks. Does anyone have any idea what's going on or how I can solve this?? Thank you. This is my php code with the link on the thumbnail....Using this the background image will change but then quickly go back to the original background image. echo "<a href=\"".$_SERVER['SCRIPT_NAME']."?page=photo&img=".($dimarray[$i][1])."&ID=".$albumID."\" onclick=\"changeBGImage()\">" . "<img src=\"" . $thumbDir . "/" . $paths[$i] . "\" alt=\"" . $paths[$i] . "\" />\n"; echo " </a>\n"; However, when I use this code the background image changes and stays... echo '<a href="#" onclick="changeBGImage(\'background\')">shanna</a>'; Is there any other code you would need to see??
  7. no worries you're explanation helped. Thank you
  8. I mean to get it to work. I can get it to work in html but I need this line of code in php and I have always been a little of unused when to use quote marks like do I need them around changeBGColor??? Thanks
  9. Hi All I always have problems knowing how many quote marks to put in, can someone help me out with this... echo '"<a href="#" onclick="changeBGColor('background')">shanna</a>"'; I know its wrong the way it is. Thanks
  10. Hi All I was just wondering if it's possible to view a websites php source code? I know that php is a server side scripting language and that it is processed at the server and the results are sent back to the browser but there always seems to be ways around everything to do with computing. Thanks
  11. I would make this as solved but I cant find the button anyway :S
  12. Thanks Yesideez that did the trick Who would of thought just a wee set of square brackets would make the difference
  13. Hi All I'm trying to create a multidimensional array using a while loop but it's not working. When I try and print out the contents of the array, it's empty. Does anyone have any ideas what I'm doing wrong??? Thanks in advance $counter = 0; $myarray = array(); while($counter <= 5) { $myarray = array($counter, $counter + 1, $counter + 2); $counter ++; }
  14. Thanks for the suggestion. I tried it and still it's not working
  15. Hi All I have an If() statement and it's not returning the result I want and I can't figure out why. I have printed values out to screen in a test program but I can't get this to work. I really need some advice. Thanks in advance. The input string will be 'images\alcatraz.jpg' What I want to happen is, if the input string has 'images\' in front of it I want to strip that off and just use 'alcatraz.jpg'. If it doesn't have 'images\' in front then I want to add 'thumbs\'. This is my code.. header("Content-type: image/png"); $dir = "thumbs/"; $filename = $_GET['image']; $thumbWidth = 50; $thumbHeight = 50; $substr = substr($filename, 0, 6); $len = strlen($filename); if($substr === "images") { $img = imagecreatefromjpeg(substr($filename, 8, $len); } else { // load image $img = imagecreatefromjpeg($dir . $filename); } // get image size $width = imagesx($img); $height = imagesy($img); // find wide picture if ($width > $height) { $newWidth = $thumbWidth; $newHeight = $thumbWidth * ($height/$width); } else { $newWidth = $thumbHeight * ($width/$height); $newHeight = $thumbHeight; } // create temporary image $tempImg = imagecreatetruecolor($newWidth, $newHeight); // create the thumbnail imagecopyresampled($tempImg, $img, 0, 0, 0, 0, $newWidth, $newHeight, $width, $height); // output thumbnail imagepng($tempImg);
  16. echo what out? I already echoed out contents of $pic array but it came out blank.
  17. Hi All I have some code that I'm trying to retrieve info from a database. When I run the query in phpmyadmin the correct records are returned, however, when I used it in my php code it returns nothing. Does anyone have any idea what's going wrong. This is my code.. $result2 = mysql_query("SELECT pictures.ID, pictures.Path FROM pictures INNER JOIN pics_in_albums ON pictures.ID = pics_in_albums.PicID INNER JOIN albums ON pics_in_albums.AlbumID = albums.ID WHERE albums.DateAdded <= '2009-10-01' AND pictures.DateAdded >= '2009-10-01'") or die(mysql_error()); ... ... while($row2 = mysql_fetch_assoc($result2)) { $pic[$count] = $row2['pictures.Path']; $count++; } Thanks
  18. I didn't want to save the image as I'm only going to use it for a short while and then not again. I can post my code and my problem is not knowing how to create images 'on the fly' when the headers have already been sent out. my index.php... <html> ... <body> <?php include('welcome.php'); ?> </body> </html> This is welcome.php... I called resize($coverPic[1]) as a test to see if the function is working. <?php include('connection.php'); function resize($cover) { $filename = $cover; $dir = "images/"; $thumbWidth = 50; $thumbHeight = 50; // load image $img = imagecreatefromjpeg($dir . $filename); // get image size $width = imagesx($img); $height = imagesy($img); // find wide picture if ($width > $height) { $newWidth = $thumbWidth; $newHeight = $thumbWidth * ($height/$width); } else { $newWidth = $thumbHeight * ($width/$height); $newHeight = $thumbHeight; } // create temporary image $tempImg = imagecreatetruecolor($newWidth, $newHeight); // create the thumbnail imagecopyresampled($tempImg, $img, 0, 0, 0, 0, $newWidth, $newHeight, $width, $height); // output thumbnail imagejpeg($tempImg); } // get date 30 days previous $date = date('Y-m-d', strtotime("-30 days")); $sql = "SELECT * FROM albums WHERE DateAdded >= '" . $date . "'"; $result = mysql_query($sql); $title = array(); $ID = array(); $coverPic = array(); $counter = 0; while($row = mysql_fetch_array($result)) { $title[$counter] = $row['Title']; $ID[$counter] = $row['ID']; $coverPic[$counter] = $row['CoverPic']; $counter++; } // resize coverpic resize($coverPic[1]); echo "<p>New albums that have been added: "; for($i = 0; $i <= $counter; $i++) { echo '<a href=photoGallery.php?ID=' . $ID[$i] . '>' . $title[$i] . '</a>' . " "; } echo "."; ?> Thanks
  19. Hi Everyone I'm trying to create an online photo gallery and right now I'm working on an update page for it. This page will inform the user of newly added photo albums and images added to existing albums. What I wanted to do was display a little thumbnail of the album cover along with the album name so the user could click on that and it would take them directly to the new album. I have the link working no problem, my problem is with creating the small thumbnails. I was hoping to do this 'on the fly' using phps gd library. However, when I do this my output is a load of letters, numbers and symbols. I'm guessing this is because I've already sent my headers out. The php file that I'm trying to do this in is included in the main page. I..e in my main page, I use include('name_of_my_view_updates_pages.php'). I wanted to use the 'on the fly' creation instead of saving more images. Is it possible to do it this way?? I'm a little confused on how to go about making it work. Thanks in advance
  20. Oh great, thanks for letting me know that. Now Im curious though about the anchors. I was looking at putting those in and I'm a little confused how I would do it since my links are a little more complicated than the examples mikesta gave. For example, the link I would use to jump to the anchor would be... <a href=photoGallery.php?ID=$ID> And this link is in a php file that is an include() in albums.php. Does that make sense?
  21. Hi All I've just started putting my website online and I realised one more thing I'd like to do to my site but have no clue where to start. I have a photo gallery and when the page opens, the page opens from the top so only the top half of the image is shown and the user has to scroll down to view the whole image. This is what I mean.. http://www.pictiuirshannagh.5gigs.net/photoGallery.php?ID=1 Does anyone know how/if to make it so that when the page opens, its positioned so the image is in view and the user doesnt have to scroll down?? So essentially the page will open already scrolled down a bit. I hope this makes sense. Thanks :-)
  22. Hi All I'm not sure where to ask for help on this but I hope someone can offer some. I'm at the point now where I'm trying to make my website live and the problem I've come across is updating my links, particularly the ones where I use header(). This is my first time putting a website online so this is all new to me. This is my line of code.. header('Location: http://localhost/website/places.php'); I need to change this but I'm not sure what to change it to. My home path is.. /home/vol11/5gigs.net/fiveg_4348489 Do I need to use that?? I appreciate any help. thanks
  23. Hi All I need some advice. I have a photo gallery that is working and I have a comments page that is working but what I want to do now is put the comments in the photo gallery. So the user can leave comments on each photo and when the photo is displayed the comments will also be displayed. The comments page only shows 5 entries per page and then there are links that allow the user move between pages to view all the other entries. However, I'd like it so that when the user moves between the comments pages the photo is still displayed. Does anyone know how I can do this? I've been trying but not having any success. Thank you.
×
×
  • 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.