954,576 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to refresh difference php file by click button in another php file

how can i refresh php page by click button (onclick funtion) in another php file

i have 2 file : a.php & b.php

so how to refresh page in b.php by click button in a.php

hope anyone can help me. Thanks

gymie1980
Newbie Poster
3 posts since Jan 2011
Reputation Points: 10
Solved Threads: 0
 

The simplest way is to have an hidden IFRAME and the second PHP file to trigger a JavaScript function that changes the innerHTML of a div in the first page. But the real solution is just AJAX.

jkon
Posting Whiz in Training
281 posts since Jan 2009
Reputation Points: 77
Solved Threads: 47
 

I agree ajax is the way to go. I suggest using jquery for handling ajax.

diafol
Rhod Gilbert Fan (ardav)
Moderator
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
 

thanks jkon and ardav!

gymie1980
Newbie Poster
3 posts since Jan 2011
Reputation Points: 10
Solved Threads: 0
 

Yes, jQuery is one of the best way to do this, because of simple.... look here for more help ! http://www.w3schools.com/jquery/jquery_ajax.asp

P0lT10n
Posting Whiz in Training
235 posts since Apr 2010
Reputation Points: 13
Solved Threads: 30
 

thanks P0lT10n..

gymie1980
Newbie Poster
3 posts since Jan 2011
Reputation Points: 10
Solved Threads: 0
 

;)

P0lT10n
Posting Whiz in Training
235 posts since Apr 2010
Reputation Points: 13
Solved Threads: 30
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: