Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Senior Coder
    Join Date
    Jun 2008
    Location
    Cornwall
    Posts
    2,099
    Thanks
    297
    Thanked 12 Times in 12 Posts

    Exclamation Creating a popup which runs a script

    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

    Code:
                        <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
    Last edited by LJackson; 03-18-2010 at 03:48 PM.

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    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.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • #3
    Senior Coder
    Join Date
    Jun 2008
    Location
    Cornwall
    Posts
    2,099
    Thanks
    297
    Thanked 12 Times in 12 Posts
    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

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Yeah, that has nothing to do with PHP.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • #5
    Senior Coder
    Join Date
    Jun 2008
    Location
    Cornwall
    Posts
    2,099
    Thanks
    297
    Thanked 12 Times in 12 Posts
    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
    Code:
    						<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

  • #6
    Senior Coder
    Join Date
    Jun 2008
    Location
    Cornwall
    Posts
    2,099
    Thanks
    297
    Thanked 12 Times in 12 Posts
    ok just seen you reply above

    i'll post in the Javascript forum

    thanks
    Luke


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •