Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Cross-Domain Script Workaround

  1. #1
    Join Date
    Jan 2007
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Cross-Domain Script Workaround

    I recently learned that it is not possible to access the html from another window or frame from another domain. I am making a script to determine if yahoo is logged on or not and have exhausted all other possiblities.

    I was wondering if it was possible to store a script on Geocities which will then have the ability to read html from another page on the same domain.
    The script could use ajax or form POST to send the desired html content to an external domain.

    Is this logical/possible???

  2. #2
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    What do you mean by "if Yahoo is logged on or not"? I am not sure I follow exactly what you are after.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  3. #3
    Join Date
    Jan 2007
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Heres my previous post: http://www.dynamicdrive.com/forums/s...ad.php?t=16522

    I am trying to determine the logon status of a yahoo id by looking for certain text in yahoo/geocities page.

  4. #4
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Ahh.. in that case, I will say no it is not possible. Yahoo is checking the status of their own log ins based on their server. That information is most likely parsed server side with some PHP/MySQL mixture. You would need admin status to be able to get the information from their server.

    The best you could hope for (and this would also be near impossible) is to link your Yahoo messenger buddy list to the script and check if your own buddies were online.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  5. #5
    Join Date
    Jan 2007
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I know I can't read login status directly through yahoo. I also know that I can't decrypt the yahoo cookie and gather the info that way. My method is completely different.
    Example: If you are logged on to yahoo network (not Y!Mess.) and you visitied any page in the yahoo or geocities net work you would see this text at the top of the page..

    Welcome, screen_name1111
    [Sign out, My account]

    I want to determine if this text is there and what screenname it says. That will tell me if a user is logged in and what user it is. I know how to copy the html from a certain element from one page to another if they are on the same domain. So, I got the idea of putting the page containing the script on the geocities domain therefore copying html from geocities.com loaded in iframe and writing to parent page. The data could then be SENT to another domain.

    I hope this further clarification is useful.
    All help is appreciated.

  6. #6
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    That's just it, either messenger or not, the method is the same, the only way to get what you are after is to hope Yahoo uses a plain HTML log in script, which they do not. That message you are seeing is displayed by PHP. Which runs on the server, not the browser.

    it would be something like:

    PHP Code:
    if {$user is logged {
       
    display $login;
    }

    else{ 
    display $notlogged;
    }

    Obviously this is not a working script...

    The idea is that you would need to have access to the php files that tell the script what the variable are, and copy those, THEN be able to access the SQL database and run the same check their script does (the if user is logged part)

    So basically, according to the browser "that text" is always displayed, just exactly what that text says changes.

    Does that make sense?
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  7. #7
    Join Date
    Jan 2007
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I don't think you are catchin my drift..

    The Welcome text is only displayed on yahoo pages after one is logged in. These pages read from the cookie left by yahoo at login and display the screenname on the page.

    If the following script were on the geocities domain (i.e. http://geocities.com/screenname38272/index.htm) and loaded geocities in an iframe it could then access the html inside the iframe.. right?

    //The welcome text is in <div id="welcome"> on geocities.com so..

    HTML Code:
    html>
    <head>
    <script type="text/javascript">
    function copyInnerHTML()
      {
      document.write(window.frames.zzz.getElementById("welcome").innerHTML);
      }
    </script>
    </head>
    <body>
    <iframe name="zzz" src="http://geocities.com"></iframe>
    <br /><br>
    <input type="button" onclick=copyInnerHTML() value="Logged In ScreenName?" />
    
    </body>
    </html>

  8. #8
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Okay, I see. Theoretically yes. but there is something about your code... I don't know what at the moment, but you are missing something.

    I will try to think of what and see what I can come up with.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  9. #9
    Join Date
    Jan 2007
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Yea I was hoping this way would work since It is now on the same domain but the script still doesn't work for some reason.

  10. #10
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Something because it is a div inside a div inside a div. I am not sure how to fix it though.

    You have 2 other elements to get through "geohead" and "rightside"
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

Bookmarks

Posting Permissions

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