Results 1 to 10 of 10

Thread: Calling on a .php file in iframe

  1. #1
    Join Date
    Mar 2006
    Location
    Montreal
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Calling on a .php file in iframe

    Hello all. I am faced with an issue that has me puzzled. I am a major newbie in the area of .php. Recently, I had created an iframe on my web site that called various dates and events from a calendar that I had. I used the iframe scroller code supplied and everything was working well. I made the necessary changes to refer to the calendar's upcoming.php file, which held information on all upcoming dates and events. After making some changes to other areas of my site, I was forced to recreate the page in question, however now, the content within the iframe (upcoming.php) is still shown, but it is stationary. Am I forgetting something? It used to flow nicely. The iframe code itself initially asks to refer to a file called external.htm which one is to upload to their servers, however I am almost certain that I had made some changes, so that it pointed to my upcoming.php file. In any case, the issue lies with the javascript which is in the original external.htm file provided with the iframe scroller code and the fact that it is not in the upcoming.php file. Is there any way to get it in there? Would this allow said dates within the iframe to scroll automatically as they used to before? I am sorry if it sounds like I am rambling and I promise to be more direct and to the point as my "posting experience" grows.

    Thanking you in advance for your time and assistance, I remain,

    John.

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    I'm tired... I didn't quite follow that.

    Not to drag the thread off topic, but let me try at stab at this... if its right, great... if not, it's probly related:

    Can php work between frames? If so, how?

  3. #3
    Join Date
    Mar 2006
    Location
    Montreal
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default In Short...

    Okay, it seems like I DID indeed ramble up there. I need to have the iframe scroller supplied in this site get it's content from a .php file and not from the external.htm file it says to get it from. The .php file whose content I want scrolling in this iframe is automatically changed on a daily basis. I can get the iframe to show the content of the .php file, but it does not scroll and remains fixed. How do I get it to automatically scroll? Any better, buddy?

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Ok... got the issue... kinda got that before. the issue i'm seeing is that I really don't know what the setup is. Sorry.... I just don't have enough info to really know.

    My only guess is that your php page has something overriding something that the old html page doesn't... meaning it'll be just a matter of modifying the php to be compliant with the html of the other page. ...I think.

    Perhaps a link in this case might be most helpful.


    hmm... one more question... what's this iframe scroller... a script of some sort, right? js?

  5. #5
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I daresay it has nothing to do with the PHP at all. We'll need to see the source of this iframe scroller, though.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  6. #6
    Join Date
    Mar 2006
    Location
    Montreal
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Here is the code, as per your request

    <html>

    <body>

    <script type="text/javascript">

    /***********************************************
    * IFRAME Scroller script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
    ***********************************************/

    //specify path to your external page:
    var iframesrc="external.htm" <----THIS IS WHAT I CHANGED TO update.php

    //You may change most attributes of iframe tag below, such as width and height:
    document.write('<iframe id="datamain" src="'+iframesrc+'" width="150px" height="150px" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="1" scrolling="no"></iframe>')

    </script>

    </body>
    </html>

  7. #7
    Join Date
    Mar 2006
    Location
    Montreal
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default And this is what was asked also

    It was also mentioned that when creating the file that was to be called into the iframe, that the following .htm file was to be placed on the server. I have changed the .htm file for a .php file though...so which part of the below code must be included into the .php file?
    ********************************************************
    <html>
    <body>

    <div id="datacontainer" style="position:absolute;left:1px;top:10px;width:100%" onMouseover="scrollspeed=0" onMouseout="scrollspeed=cache">

    <!-- ADD YOUR SCROLLER CONTENT INSIDE HERE -->

    <b>What's Hot</b></p>
    <p align="left"><strong><font face="Verdana"><small><a href="http://www.dynamicdrive.com/dynamicindex9/encrypter.htm" target="_top">Source
    code encrypter</a>&nbsp;</small></font></strong><br>
    <font face="Verdana" size="2">Scramble the source of any chunk of code using
    this unique script.</font></p>
    <p align="left"><strong><font face="Verdana"><small><a href="http://www.dynamicdrive.com/dynamicindex5/flashlink.htm" target="_top">Flashing
    links</a>&nbsp;</small></font></strong><br>
    <font face="Verdana"><small>Bring attention to special links, by making them
    flash!</small></font></p>
    <p align="left"><small><strong><font face="Verdana"><a href="http://www.dynamicdrive.com/dynamicindex13/roamcursor.htm" target="_top">Roaming
    Cursor</a>&nbsp;</font></strong></small><br>
    <small><font face="Verdana">Display a second, &quot;roaming&quot; cursor on your
    page with this fun animation script.</font></small></p>
    <p align="left"><font face="Verdana"><strong><a href="http://www.dynamicdrive.com/dynamicindex11/animatedtitle.htm" target="_top"><small>Animated
    Document title</small></a><br>
    </strong><small>Animate into view your document's title!</small></font>

    <!-- END SCROLLER CONTENT -->

    </div>

    <script type="text/javascript">

    /***********************************************
    * IFRAME Scroller script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
    ***********************************************/

    //Specify speed of scroll. Larger=faster (ie: 5)
    var scrollspeed=cache=2

    //Specify intial delay before scroller starts scrolling (in miliseconds):
    var initialdelay=500

    function initializeScroller(){
    dataobj=document.all? document.all.datacontainer : document.getElementById("datacontainer")
    dataobj.style.top="5px"
    setTimeout("getdataheight()", initialdelay)
    }

    function getdataheight(){
    thelength=dataobj.offsetHeight
    if (thelength==0)
    setTimeout("getdataheight()",10)
    else
    scrollDiv()
    }

    function scrollDiv(){
    dataobj.style.top=parseInt(dataobj.style.top)-scrollspeed+"px"
    if (parseInt(dataobj.style.top)<thelength*(-1))
    dataobj.style.top="5px"
    setTimeout("scrollDiv()",40)
    }

    if (window.addEventListener)
    window.addEventListener("load", initializeScroller, false)
    else if (window.attachEvent)
    window.attachEvent("onload", initializeScroller)
    else
    window.onload=initializeScroller

    </script>

    </body>
    </html>

  8. #8
    Join Date
    Mar 2006
    Location
    Montreal
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default And finally, the link to the scroller...

    Here is where the initial code was found.

    http://www.dynamicdrive.com/dynamici...e-scroller.htm

    Again, thanks for all your time and assistance, people! It is much appreciated!

  9. #9
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    I'll agree with twey... it's not php. php is just a different extension for html, ignoring dynamic content on those pages... it won't affect the functionality of js, I wouldn't think anyway.

    I don't know enough about JS to work it out myself.

    Thoughts:
    check the above code for ".htm" and try switching to ".php"
    And... in the first thing you posted, it says 'scrolling=no'... sure that's right?

  10. #10
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    so which part of the below code must be included into the .php file?
    Everything except the contents of the <div> should stay the same.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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
  •