Jump to content

Default id passed upon page load


kurt.santo

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...