开发者

javascript get variable open in new window

I have standard text links which all say "Full View". When clicked these links send out php in this form: http://mysite.com/fullview.php?myimage=30

Basically there's thumbnailed images and text links that say full view. I'd like for fullview.php to capture the myimage variable, and display it as a full sized image. Meaning, a blank page (fullview.php) displaying the image. Sounds likes javascript to me.

开发者_StackOverflow

How do you put the javascript into fullview.php to capture the variable and display it as a full sized image?

myimage=30 can be any number example: myimage=942

Thanks for any help, Darrell


If you just want to display a full-sized view of images, you may consider using a JavaScript image display library, such as fancybox. You can probably achieve what you want with the autoDimensions: true option, which is the default.


I think you are passing image id(myimage=30) to fullview.php. So you can simply get it with $_GET['myimage'] in fullview.php. Now you can use this imageid to get image and just display it with HTML <img> tag.

For example in fullview.php

if( isset( $_GET['myimage'] ) ) {
   $imageid = $_GET['myimage'];
   echo "<img src='/images/folder/path/" . $imageid . ".jpg' />";
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜