Javascript with php variables for image sizing popup

Javascript coding ..

Moderators: egami, macek, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 16
Joined: Tue Nov 18, 2003 1:18 am

Fri Dec 19, 2003 12:35 am

Hello everyone.

I got a PHP Javascript problem.

This code actually works poping up the images but the size of the image doesnt display
fully in it.

I took out part of the code to make it more readable.

My questions is.
What is wrong in this code as I said that the images do not popup with the image size that
is being read by php script.

Thanks for any help with this and best regards,


Code: Select all

Image size reading!

 @$getsize = getimagesize("$getimagelink");
        @$imagew = $getsize[0];
        @$imageh = $getsize[1];

JavaScript using the php variables in it!

    <script language="JavaScript">
        function pop(URL) {
                var windoww =,"","width=<? echo $imagew; ?>","height=<? echo $imageh; ?>"," toolbars=0","scrollbars=0","left=0","top=0","statusbar=0","location=0","menubar=0","resizable=0")

The line with the pop code from javascript!

echo "<td width=\"20%\" style=\"border-bottom: 1px solid #FF0000;\"><center><a href=\"javascript:pop('$getimagelink','$imageh','$imagew')\" ><img border=\"1\" src=\"admin/$que_tabla/$imagen.jpg\" width=\"140\" height=\"88\"></a></center></td>";

Post Reply