but I want to be automatically redirected without having to click the link "Go to album". Also I want the new page to open in the same tab, not a new one. I mostly copied and pasted the code from different sites so I'm not sure what all the code means. Is it the "new_win" that is telling it to open in a new window or tab and if so, what coding should be used to open in the same tab. Also, as I said I don't want to have to click anything.

Then:

On another page I want to somehow incorporate this script and combine the href variables with a variable submitted through php. Here is the code of the php file:

In the red href code I want to also ad the myWidth and myHeight variables from the above javascript code (the green code is similar to what I want but I don't know that it is written correctly since they are javascript variables I am wanting but hopefully you get the idea of what I want). Since this is a different php file I will also need to add the javascript code in an echo statement but will probably need to modified somewhat since I will just be needing the variables from it and not open a new page. I hope you understand what I mean.

So could I get some help with the redirecting issue and also how I would need to change my javascript code and combine it with my php code in order to get the desired results.

This is the php file used to view the photos. When I click the previous or next buttons it will reopen the page with a new id value in the href (shown in red). So in order to get the dimensions every time I reopen the same page I will need to resend the javascript code. Would you use the same javascript as in the First Code you explained and just ignore the window.location.href... and the <a href="#"...> but still keep the <body onLoad="alertSize();">?

The reason I would like to send the script every refresh is because of the fact that the user may change his/her browser size while viewing. I suppose I could just have a static value and they would then need to return to the index in order to refresh the dimension variables. If you have any other ideas about this they would be welcome but keep in mind I'm new to javascript and quite new to php so it will need to be kept simple.

Just out of curiosity is $_GET and $_REQUEST exactly the same and can they be interchanged.