|
How to refresh iframe in php ?
I have 4 iframe in my php and want to refresh all.Example:-
<div id="l1" style="position:absolute;left:50px;top:120px;width:450px;height:140px;z-index:35" align="left"><iframe frameborder=0 src="http://ck.com/ker.php?scrip=echo $us" width=412 height=160</frame>/div>
|
|
|
|
|
I'm very confused. Do you want to refresh the iframe 's during run-time i.e. after the page has loaded? Because I do not see how you can do that with PHP, it would have to be Javascript.
The only possible time you can use PHP is before the page has loaded, in which case it would be pointless as the iframe would be loaded anyway. Everything after the page load has to be done with Javascript.
Here is how to refresh the iframe in Javascript:
document.getElementById('iframe1').contentWindow.location.reload(true);
If at first you don't succeed, you're not Chuck Norris.
|
|
|
|
|
Thanks for your help.I want to refresh iframe after loading page and after every 1 minute.If it is not possible in php then can you tell how to insert java script function in php for refreshing iframe.If you can try to give me a very short example.
Thank You
|
|
|
|
|
udch wrote: If it is not possible in php then can you tell how to insert java script function in php for refreshing iframe.
Your statement shows a clear lack of understanding about how HTML, PHP and Javascript work.
In the below example you can see how to use PHP with HTML correctly. You can see that the HTML tags are not written in PHP. The only part of this page that is affected by PHP is the body which will have 'Hello World!!' written in it.
Also see how the Javascript is in the <script></script> tags. Make sure you give the type of the script block which in this case will be text/javascript .
Your Javascript functions will now go in the script tags, as shown. Notice that in the function refreshIframes() there is a setTimeout() function which calls the function given as the first parameter ('refreshIframes()' in this case) and the number of milliseconds to wait for it to call as the second parameter (60000 in this case [60 seconds]).
Please also note that onload="refreshIframes()" is in the body tag, this calls the refreshIframes() function once the page has loaded.
<html>
<head>
<title>Hello World</title>
<script type="text/javascript">
function refreshIframes()
{
setTimeout('refreshIframes()', 60000);
}
</script>
</head>
<body onload="refreshIframes()">
<?
echo 'Hello world!!';
?>
<!-- INSERT IFRAME HERE! -->
</body>
</html>
If at first you don't succeed, you're not Chuck Norris.
|
|
|
|
|
Can php refresh function after loading a page ?
|
|
|
|
|
No.
If at first you don't succeed, you're not Chuck Norris.
|
|
|
|
|
Thanks for you help brother
|
|
|
|
|
|
|
I am trying like this but it is not working can any one tell me how to do this ?
<?php
for($i=0;;$i++)
{
$us=500425
ch();
sleep(15);
$us=500547;
}
function ch()
{
<div id="bv_Html1" style="position:absolute;left:50px;top:120px;width:450px;height:140px;z-index:35" align="left">
<iframe frameborder=0 src="http://abc.com/ker.php?scrip=echo $us" width=412 height=160></frame></div>
}
?>
|
|
|
|
|
|
I want to call function ch() after every 15 second until web page is open. How can i do this ? I tried it but not succeed it.
|
|
|
|
|
udch wrote: for($i=0;;$i++)
you need to fix this line ie:
for($i=0;$i<10;$i++)
|
|
|
|
|
Thanks for your help brother.Is this code is ok because i am getting this error massage
"parse error (unexpected token `id') -- (id . ch)"
<?php
for($i=0;$i<1000;$i++)
{
$us=500425
ch($us);
sleep(15);
$us=500547;
ch($us);
}
function ch($us)
{
echo $us;
}
?>
|
|
|
|
|
|
|
read a web live data(news headlines)feed to a port on my comp. i've been messing with just about everything related with little to no results. This is basicly working on. The download (wget) a client (knews) a server ( news.readfreenews.net). Too many dead ends to describe. So i did manage to get something from downloading first but that shouldn;t have worked, just a bunch of nothing going to my display. The thing i'm looking for is like those text to speech programs. Some will check your mail, the one i got tells the headlines from a separate website, updated of course. Things are getting really messed up. So that's it, one line of code, like: bash bash2 | tr a-z A-Z | nc localhost 6667. bash2 would be what i'm missing. I'm new at this so for someone like you, a piece of cake right? So a direct text feed to the port that's it. thx
|
|
|
|
|
An warning i am getting when i am opening a text file from my own website in Linux hosting
Warning: file(http://iy.com/tata/y.txt) [<a href='function.file'>function.file</a>]: failed to open stream: HTTP request failed! HTTP/1.1 401 Authorization Required
in <b>/home/iy/public_html/do.php</b>;
can any one tell me how to solve it ?
|
|
|
|
|
Means a password is required to open files in that directory - or it could possible mean you havent set the right permissions on the file.
If you do not have a "password protect directories" option on your hosting control panel look up ".htaccess" and ".htpasswd" files.
Alternatively put it in a directory without pw protection.
|
|
|
|
|
Thanks for your help brother directory is password protected can your tell me first line of do write user name and password in php for opening file.
|
|
|
|
|
|
|
Thanks for all your help brother.You are really a nice hearted human.
|
|
|
|
|
can anybody please tell me which book is the best for beginers to learn python.
|
|
|
|
|
Greetings:
If you're an experienced programmer, Mark Pilgrim's Dive Into Python is an excellent introduction to the language. The printed edition is from APress, and can be easily found on-line and through book retailers. However, since the book was written and released under the GNU Free Documentation License, the book in its entirety is available in a variety of electronic formats, including PDF and HTML at http://diveintopython.org/[^].
If you have very little practical programming experience in other languages, Alan Gaud's Learn to Program Using Python: A Tutorial for Hobbyists, Self-Starters, and All Who Want to Learn the Art of Computer Programming from Addison-Wesley may be a good place to start. The author's web site, along with some of the material covered in his book, is available on-line at http://www.freenetpages.co.uk/hp/alan.gauld/[^].
I hope this was of help...
|
|
|
|