/    Sign up×
Community /Pin to ProfileBookmark

javascript + php = help!

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!

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@pyroAug 18.2003 — 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
Copy linkTweet thisAlerts:
@QuasiboboAug 19.2003 — 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>
×

Success!

Help @metrosoccer12 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.1,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...