I'm trying to build a small portfolio and instead of using several HTML pages I wanted to just use PHP. What I have is an array of each image's path (for the "src" attribute). I was thinking when I click "Next" (a text link) it increments the array and once it has reloaded itself it would simply look at the query string then display the new image.
I have some questions though:
1. What line do I use which will reload the page with the new incremented variables?
2. When the page reloads itself, will it automatically get the new image to load? I already placed $thisimage = $_GET['imagenumber'] at the very top so it updates the "src" attribute for the image.
Thanks in advance. Any help/suggestions would be great, especially with that reloading part.
Reloading the page with updated query string values
Moderator: General Moderators
- Josh1billion
- Forum Contributor
- Posts: 316
- Joined: Tue Sep 11, 2007 3:25 pm
Hm.. what if you just had the "Next" button link to the URL with the next id?
If it was an HTML link instead of a Next button, you could just do this (adapt it to be in button format, or an image, if you wish):
If it was an HTML link instead of a Next button, you could just do this (adapt it to be in button format, or an image, if you wish):
Code: Select all
$next_image_number = $_GET['imagenumber'] + 1;
print "<a href='display.php?imagenumber=$next_image_number'>Click here to see the next image</a>";