Jump to content

smonkcaptain

Members
  • Posts

    66
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

smonkcaptain's Achievements

Member

Member (2/5)

0

Reputation

  1. Hey all, If you visit my website here: www.flightphotos.net You will see that i have centered the logos and content. If you have a smaller resolution or resize the window so it's small, the content stays centered until the page width is smaller than the content width. How can i ensure the content is always say 40 px from the left, so it appear centered even when the window is resized? Thanks, Jimmy.
  2. That's fantastic! Thanks for all your help guys, much appriciated.
  3. Works perfectly, thankyou very much! One last thing, If i click on an image twice, then the image $id get's posted into the session array twice, how can i stop this from happening and as a result stop duplicate copies of 'recently viewed photos'? Thanks
  4. Ok, ignore my previous post, I've sorted it now. Here is the code i have: <?php function addTolastViewed($id) { if(isset($_GET['id'])){ $maxcount = 6; $lastv = array(); if (is_array($_SESSION['lastViewed'])) $lastv = $_SESSION['lastViewed']; array_unshift($lastv, $id); if (count($lastv) > $maxcount) array_pop($lastv); $_SESSION['lastViewed'] = $lastv; } } session_start(); addTolastViewed($id); echo "This id: $id </br>"; echo '<pre>'; var_dump($_SESSION['lastViewed']); echo '</pre>'; ?> How can i now display the images using the variables as the id from the array? Thanks all!
  5. That's brill thanks! However, i'm using the function() on one page, and echoing the array on another to dsiplay the recent viewed photos, and getting this error: Fatal error: Call to undefined function addtolastviewed() in /home/fhlinux009/a/aviation-photographs.net/user/htdocs/results.php on line 241
  6. How can I make the session have mutliple values then, because whenever i visit an image it's just overwrites the session with the new $id?
  7. Thank's mate. I'm a newbie but will give it a go! First of all, this code i've started to write doesnt even show up in page info/cookies/sessions? Also i get an error 'Parse error: syntax error, unexpected ';' in /home/fhlinux009/a/aviation-photographs.net/user/htdocs/photo.php on line 25' having the & sign after $id. if(!isset($_SESSION['recent'])){ $_SESSION['recent'] = $id&; } Manage to sort the error... just me being silly. This is what i have so far: <?php if(!isset($_SESSION['recent'])){ $_SESSION['recent'] = $id.'&'; } else if (isset($_SESSION['recent'])){ $session = $_SESSION['recent']; $recent = explode("&", $session); } ?>
  8. Thank's mate. I'm a newbie but will give it a go! First of all, this code i've started to write doesnt even show up in page info/cookies/sessions? Also i get an error 'Parse error: syntax error, unexpected ';' in /home/fhlinux009/a/aviation-photographs.net/user/htdocs/photo.php on line 25' having the & sign after $id. if(!isset($_SESSION['recent'])){ $_SESSION['recent'] = $id&; }
  9. Thanks for the repsonse! Would you have any idea how you would achieve this then? $id = //id of photo clicked on session_start(); $_SESSION['id'] = $id.. <img src="images/$id.jpg"></img> But that'd only be for one!?
  10. Hey all, http://www.adamrowden.co.uk/photo-searchr.asp If you visit this link, you'll see on the left side you have a few photos. If you click a photo from that page and then go back to the link i've provided you'll see that it shows you your 'recently viewed photos'. I'm wanting to do exactly that and need some pointers on how i would!? I'd be very grateful for any help Thanks, Jimmy m
  11. Thanks, i've managed to do it with sessions
  12. Thanks for the reply, I will take a look. Maybe i havent specified the question too well; Basically, people use my form to search my photodatabase. I'm using $_POST to send data from the form to the query on the results page. If i was to use $_GET i'd have a rather messy URL after anyone searched.. for example: results.php?aircraft=747&airline=BritishAirways&blah=etc.... Hence choosing to use $_POST because it means whatever the search, the url will always be just search.php. However, When a user clicks on a result, it goes to a new page, and i what to be able to have a 'back' button which then takes them back to the results page with the correct search criteria they have choosen. Is this only possible with $_GET? Thanks
  13. Hey all, How can i get the current URL including any $_POST variables which arent visible? Thanks.
  14. Hey all, Say i performed this query: <?php $search=mysql_query("SELECT * FROM `photos` WHERE genre LIKE 'Airliner' AND location LIKE 'London Heathrow");?> and the query throws out the array of: array ( [0] => '223', [1] => '538', [2] => '411' [3] => '411' ) the numbers being the 'ID' of the photo.. How can i code it so that i can echo the previous or next id in the sequence? Thanks all!
  15. Thankyou very much! Top man.. Yes, the submit_query was the last element in the array. Thanks once again
×
×
  • 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.