Log in

View Full Version : iframe, please help!



william james
05-06-2010, 05:06 AM
----------------------
<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!

Beverleyh
05-08-2010, 09:17 PM
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>

william james
05-09-2010, 07:57 AM
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!

fileserverdirect
05-09-2010, 07:58 PM
If you mean to change the url in the iframe, then you could use javascript or PHP. Something along the lines of:


document.getElementById(iframe).src="http://mywebsite.com/myvideofile/01.php";

where "iframe" is the id of your iframe (which you'll need to add).

<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.

<script src="ifamejs.js" type="text/javascript></script>
*Untested* other fourm members feel free to correct