...

View Full Version : Creating a popup which runs a script



LJackson
03-18-2010, 04:38 PM
Hi All,

i have a script from amazon which loads song previews of a particular album, which is great, i have icons next to the titles of the albums on my site to prompt users to click to listen to the songs like so


<a href="song_preview.php?id=<?php echo $row['ASIN']?>">
<img src="images/listen.png" border="0" alt="Preview Songs" title="Preview Songs" /></a>


ive got it working where by it loads up the page song_preview.php but i would ike for it to load on the same page as a pop up.

would a pop up be the best solution? as obviously popup blockers would be a pain?

thanks
Luke

Fou-Lu
03-18-2010, 08:34 PM
By popup, you mean a new window correct? In that case, if the links are in that window and have not been retargeted, it should automatically load in that window, not the parent.
If you're asking how to do this without a reload, that would be AJAX and not PHP.

LJackson
03-18-2010, 10:15 PM
hi mate yeah a new window but the size of the widget not a full sized window if you know what i mean? like a pop up.

it currently shows a new window but its a full window which i dont want? do i need to use javascript for this?

thanks
Luke

Fou-Lu
03-18-2010, 10:33 PM
Yeah, that has nothing to do with PHP.

LJackson
03-18-2010, 10:47 PM
i found this example http://blazonry.com/javascript/windows.php

but im not sure how to make it work for me?

so i have this

<img src="images/listen.png" border="0" alt="Preview Songs" title="Preview Songs" onclick="window.open("song_preview.php?id=<?php echo $row['ASIN']?>","Window1","menubar=no,width=430,height=360,toolbar=no");" />

but it loads the pop up at the same time the page loads up and not when an image is clicked?

plus when i first loaded the page it said pop up blocked which sucks!! on the example i didnt get that, any reason why???

sorry if this is more javascript now.

thanks
Luke

LJackson
03-18-2010, 10:47 PM
ok just seen you reply above :)

i'll post in the Javascript forum :)

thanks
Luke



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum