Click to See Complete Forum and Search --> : javascript + php = help!


metrosoccer12
08-17-2003, 09:25 PM
okay i have a javascript code that i want to make into php:

i want this:
<a href="#" onClick="popimage('pictures/1.jpg',600,300);return false">Picture 1</a><br>

to work with:
<?PHP

$pic = "yourimage.gif";

$wh = getimagesize($pic);
$width = $wh[0];
$height = $wh[1];

echo $width."x".$height;

?>

i want this:

echo $width."x".$height;

to give like the window sizes so it would be like:
('pictures/1.jpg',$width,$height)

or however it can be done... I plan on using this a few times if u know what i mean for all my pics...

If anyone can help... then help lol

thanks in advance!

pyro
08-17-2003, 09:32 PM
Since this is going to require javascript anyway, it would probably be easier to use a pure javascript solution: http://www.infinitypages.com/research/imagepopup.htm

Quasibobo
08-19-2003, 04:56 PM
Or the way you want:

<a href="#" onClick="popimage('pictures/1.jpg',<?php print($width);?>,<?php print($height);?>);return false">Picture 1</a>

or:

<a href="#" onClick="popimage('pictures/1.jpg',<?php print($width.",".$height);?>);return false">Picture 1</a>