Results 1 to 4 of 4

Thread: iframe, please help!

  1. #1
    Join Date
    May 2010
    Posts
    30
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default iframe, please help!

    ----------------------
    <iframe src="myvideofile/01.php"name="frame1"scrolling="no"frameborder="no"align="center"height="420px"width="550px">
    </iframe>
    ---------------------

    literally im using that format into my page. it is working because the file source is in my server.

    I want other user to use/embed that code into their site.

    My question is, is there any way for that code to work to other site without my domain name on the src= ? (mydomain.com/myvideofile/01.php)

    hope it will make sense

    thank you in advance!

  2. #2
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    Why would the inclusion of your domain name cause a problem? I dont understand - you're offering to let users include your content via their site afterall.

    If its just a one-code-for-all simplicity thing, just use the code below on your site and they can also use it on theirs;
    <iframe src="http://mywebsite.com/myvideofile/01.php" name="frame1" scrolling="no" frameborder="no" align="center" height="420px" width="550px">
    </iframe>

  3. #3
    Join Date
    May 2010
    Posts
    30
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    Thank you for your reply

    The main reason is that if ever I want to change a domain name because of some uncertain instances( if my domain was blocked, etc) I wont change the code manually with every single post. my target is 10k posts minimum so thats a lot of work if something wrong will happen to my domain

    Is there any codes you need to add on the header, or upload a js file in your server?
    I dont have any idea if it is possible... maybe you can enlighten me about this
    thanks!
    Last edited by william james; 05-09-2010 at 11:31 AM.

  4. #4
    Join Date
    Nov 2006
    Location
    Northeast USA
    Posts
    408
    Thanks
    8
    Thanked 30 Times in 28 Posts

    Default

    If you mean to change the url in the iframe, then you could use javascript or PHP. Something along the lines of:
    Code:
    document.getElementById(iframe).src="http://mywebsite.com/myvideofile/01.php";
    where "iframe" is the id of your iframe (which you'll need to add).
    Code:
    <iframe src="http://mywebsite.com/myvideofile/error.php" name="frame1" scrolling="no" frameborder="no" align="center" height="420px" width="550px"id="iframe></iframe>
    Also make the default page an error page, just to check to see if it works.
    Now im not so hot with javascript, but you'll need to put that in a .js and use a script include on the bottom your page.
    Code:
    <script src="ifamejs.js" type="text/javascript></script>
    *Untested* other fourm members feel free to correct
    -Ben -- THE DYNAMIC DRIVERS
    My Links: My DD Profile||My Youtube Video Tutorials||DD Helping Coders||DD Coders In Training
    I told my client to press F5, the client pressed F, then 5, *facepalm*

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
  •