PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
It in interesting because you probably want to do something fairly straightforward that we could easily give you help on, but you are using words that don't have specific meanings to programmers. For example, functions are called and the code within them run -- they are not "showed." And, the statements "when there is a script on that page" and "when the script is removed" part is confusing. Scripts are not on or removed from pages. A PHP script is a file with a .php file extension that has embedded PHP code.
If it hasn't become painfully clear, before we can help you we need to know what you need help with. Please ask your question in clearer terms that we can easily understand and answer. Thanks.
If a script is on a page, then it will affect another page on a different site(It will show a script.)
If a script isn't on the page, then it wont show a script on a different site.
How is it supposed to determine if a script is on a page? Is this page local or remote to this hypothetical script? Does this script have access to the internals of said page?
If there isn't a script how is it supposed to output anything?
What is the problem you are trying to solve. Why do you need to determine "if a script is on a page"?
Do you actually know what PHP is? PHP never exists on a page, PHP generates the page in the first place the browser never sees PHP.