Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 19th, 2005, 07:30 AM
Authorized User
 
Join Date: Jul 2004
Location: rajshahi, , Bangladesh.
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to rajuru Send a message via Yahoo to rajuru
Default Javascript & PHP

I want to execute a php function every 10 seconds.
How I can do this?

Pls. some one help me

Best Regard:
Md. Zakir Hossain (Raju)
www.rubd.net
www.xenex.rubd.net
www.forum.rubd.net
__________________
Best Regard:
Md. Zakir Hossain (Raju)

www.rajuru.xenexbd.com - my blog with PHP scripts, PHP Book Review and many more
Reply With Quote
  #2 (permalink)  
Old February 19th, 2005, 09:18 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: delhi, delhi, India.
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Rajuru!!

Why Do you want to php function for every 10 seconds.Offcourse this function will be a part of PHP page,like xyz.php.
Since onec php page is executed on the server,it will send to the Client.You can then use javascript function to get values whtever may be .
I am still confusing every 10 seconds php function()??
Can you give short description for it.

Cheers :)

vinod
Reply With Quote
  #3 (permalink)  
Old February 19th, 2005, 10:42 AM
Authorized User
 
Join Date: Jul 2004
Location: rajshahi, , Bangladesh.
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to rajuru Send a message via Yahoo to rajuru
Default

Dear, thanks for quick reply.

I have a php script which displays a random image from a specific folder named rotate.
I just copy a new image to the rotate folder and it is displayed randomly by php script and for that i don't have to change my code. It automatically get the images in rotate folder.

but I want to change the image every 10 or 20 seconds. that's why I want to call rotate.php every 10 seconds

Best Regard:
Md. Zakir Hossain (Raju)
www.rubd.net
www.xenex.rubd.net
www.forum.rubd.net
Reply With Quote
  #4 (permalink)  
Old February 19th, 2005, 03:04 PM
Authorized User
 
Join Date: Jan 2005
Location: , , .
Posts: 82
Thanks: 0
Thanked 0 Times in 0 Posts
Default

how about letting javascript do this for you.

I think there is a settimeout function in javascript that you can use. I am not sure about the syntax, but you can do a recursive function that would call itself every 10 seconds. something like this:

var pic = some random image;
function changepic(){

 pic = (do random code here)
 settimeout(changepic(),10)
 return pic;
}



----------------
Never bother to learn something not knowing which does not do you any harm, and never neglect to learn something whose negligence will increase your ignorance - Imam Jafar Sadeq
Reply With Quote
  #5 (permalink)  
Old February 19th, 2005, 05:34 PM
Authorized User
 
Join Date: Apr 2004
Location: Lahore, , Pakistan.
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can use Inline Frame in HTML, to execute PHP (dynamic page) repeatly.

Like this:

<iframe src="mypage.php" name="ImageFrame">
</iframe>


Place this frame at image position.

From Burhan Khan

Reply With Quote
  #6 (permalink)  
Old February 22nd, 2005, 12:40 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: delhi, delhi, India.
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hii Rajuru!!

Alternatively you can just do swapping of images on the client side.
Since there is no redirection every time hitting the server :)


Cheers :)

vinod
Reply With Quote
  #7 (permalink)  
Old February 22nd, 2005, 06:15 AM
Authorized User
 
Join Date: Jul 2004
Location: rajshahi, , Bangladesh.
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to rajuru Send a message via Yahoo to rajuru
Default

thanks to all

I tried but failed using Javascript and at last I used inline frame.


Best Regard:
Md. Zakir Hossain (Raju)
www.rubd.net
www.xenex.rubd.net
www.forum.rubd.net
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP & Javascript ketki Pro PHP 2 January 18th, 2007 03:45 PM
PHP & JavaScript variables? mlewitz Beginning PHP 2 December 2nd, 2005 08:18 AM
PHP & JavaScript variables? mlewitz PHP Databases 2 November 30th, 2005 10:16 PM
Javascript && keeps turnig into &amp;&amp; ayrton Pro VB.NET 2002/2003 3 June 27th, 2005 03:34 PM
Error: movie.php & commit.php on p182-186, ch6 willburke BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 October 12th, 2004 02:48 PM



All times are GMT -4. The time now is 10:39 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.