Jump to content

Default id passed upon page load


kurt.santo
 Share

Recommended Posts

$id = (isset($_GET['id']) ? $_GET['id'] : 12);
I understand that it tests if the id is set and if yes, updates the value. If no, it set value to default=12. This is exactly what I am after. But where do I put this line? Tried it in head and body, but does not work... The file name is set as "<IMG src="thumbs/1-<?php echo $_GET['id']; ?>.gif">".Kurt
Link to comment
Share on other sites

Put it right at the top, and change that <img /> tag to read

<img src="thumbs/1-<?php echo $id; ?>.gif" />

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
 Share

×
×
  • Create New...