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 2 of 2
  1. #1
    Regular Coder
    Join Date
    Aug 2010
    Posts
    408
    Thanks
    17
    Thanked 2 Times in 2 Posts

    changing url with <0bject>

    I'm trying to change the parent page of site1 when someone clicks on an <object> that is sitting on site2. Not sure how to do this. Onclick doesn't seem to do anything. I would have it go to a function that changes document location, but even alert('test') isn't doing anything. Is it because they're on two different website locations? I have access to both sites, but I have to object or iframe in this item and have it change the url when clicked.

    Here's the object tag I have:
    Code:
    <object onclick="alert('test');" id="http://www.website2.com/file.html" data="http://www.website2.com/file.php" type="text/php"></object>


    and here's the basic jist of file.php:
    PHP Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html> <body style="margin:0; padding:0;"><div id=final>
                
       <?php
              
    require_once("db.php");
    $item "on_the_cover__thumb1";

    $data mysql_query("SELECT * FROM auth2es WHERE id LIKE '37' AND id2 LIKE '1'");

    $row variableThis makes it easier to echo each field.

    $link1 'http://www.site1.com/page/';

    while(
    $row mysql_fetch_array($data)){
    echo 
    '

    <a href="'
    .$link1.'"><img src="' $row['filepath1'] . '"></a>';
    }

    ?>


        </body>
    </html>

  • #2
    Regular Coder
    Join Date
    Aug 2010
    Posts
    408
    Thanks
    17
    Thanked 2 Times in 2 Posts
    scratch this question... I found the answer using javascript and post.message.


  •  

    Posting Permissions

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