Thursday, 26 September 2013

Unique URL for Images on the same page

Unique URL for Images on the same page

I am trying to integrate the Facebook like button on my website for
individual images. The easiest way I thought to do this would be to give
each image a unique URL on a page for example:
http://photography.theamateurproject.com/aurora_borealis.php?id=1074
Here is my current link code: a class={$row['class']} img
src=theamateurproject.com/uploaded_files/{$row['image']}
onclick=ChangeImage{$row['id']}()
; /a";
And I am currently using this function to change the image on click:
echo <<< EOT function ChangeImage{$row['id']}(){
document.getElementById("$image1").innerHTML= "div h1 align='center'
{$row['title']} /h1" + "a class={$row['class2']} img
src=theamateurproject.com/uploaded_files/{$row['image']} style='float:
left;' /a" + "div span {$row['description']} /span /div /div" }
Unfortunately this does not change the URL only the content in the element
div.
I am trying to convert it to PHP so that the image will have a unique URL,
but I am not having any success.
When I try editing the link to equal the image ID number it doesn't load
the image or content that goes with the image.
Any suggestions on a different route I should take? Thank you!

No comments:

Post a Comment