-1

So I have two pages, my PHP script and then an HTML page with two iframes in it.

> <html>
> 
> <iframe name=1></iframe> <iframe name=2></iframe>
> 
> </html>

Iframe2 is currently housing my PHP script. My PHP script is something like below:

<?php

if this {
do this
}

?>

What I am trying to find out is if it's possible for my IF condition within my PHP script can reload iFrame1? I've played around with different methods and onClick obviously works to reload the frame, but I need the frame to reload based on the IF condition being met and I can't really figure that out. TIA!

Schweino
  • 1
  • 1
  • Does this answer your question? [What is the difference between client-side and server-side programming?](https://stackoverflow.com/questions/13840429/what-is-the-difference-between-client-side-and-server-side-programming) – Alon Eitan Apr 25 '22 at 03:29
  • I think this explains my overall problem, but I still can't figure out exactly if it's possible for my php script to refresh an iframe. – Schweino Apr 25 '22 at 04:46
  • You've to re-read the linked article, everything is explained in multiple answers. This really is fundamental to web developement. – Teemu Apr 25 '22 at 05:12

1 Answers1

0

PHP is not able to change/reload a frame on client browser. PHP is a server-site language. You have to use javascript here like you found out: "onClick" (javascript) works.

If you like to, you can use javascript combined with ajax to ask "PHP" on the server if javascript should reload the frame.

But PHP can NOT reload anything on the browser after document is loaded.

3rdinger
  • 1
  • 1