Jump to content

How can i change the images


sudhakarReddy

Recommended Posts

Hi ,I ahd a requirement. I had a page with some full information of the perticular image. But the problem i s the images are morethan 20.the requirement is in that page i have to display the image with the related information and below that image i want two buttons one is PREVIOUS and anothe one is NEXT. when i press the NEXT button only the image have to change with the related information. Not the whole page. how can i do this in PHP.Please give me some idea about this requirement.Plz its very Urgent.ByeSudha.

Link to comment
Share on other sites

you can do this iframes, but i dont recommend them.you can use ajax, but i used that and didn't find it that easy to work with.if your on a fast internet connection, and with the pages been temporarily cached, it will seem as if the page is not reloading, and just the picture.Look at some gallery software for what your after, then we can help with it if you get stuck in trying to make it work:)

Link to comment
Share on other sites

You could do the button tag thing (never really used) and have it pointing to the same page but have it like:http://www.example.com?image=1and put in the php script:

$img = $_GET['image'];if($img == "1"){$imgdisp="img1";}elseif($img == "2"){$imgdisp="img2";}

etc..but where $imgdisp=""; is put the name of the image in the qoutes.like if you put all of the images in www.example.com/images/(image name) use the image name in the qoutes...then where you want the image to actually be displayed put this:

<img src="www.example.com/images/<? echo $imgdisp; ?>">

and all your other body script. This should work well because since all of the images to be displayed are in this one page it wont reload the whole page, only the image.. :)

Link to comment
Share on other sites

Hi sudhakar, If you don't want the browser to go back to the server to request the next page, all the content needs to be in one html document. then you use javascript/dhtml to show and hide the various pages (divs in this case) as the user requests by clicking.For example you can use DIV's for each image and hide all the DIVs except for the one that needs to display, on next button show the second div and hide others... I'm not sure if this will work, have not tried this but give this a try..HTH

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...