is this possible? (newbie question)

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!

Moderator: General Moderators

cursed
Forum Newbie
Posts: 16
Joined: Sat Aug 26, 2006 10:18 pm

is this possible? (newbie question)

Post by cursed »

Is it possible to show a php function when theres a script on that page? and when the script is removed, then the php function doesnt show?

Thanks in advance, i just started coding PHP :oops:
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Please elucidate.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

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.
(#10850)
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

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.
cursed
Forum Newbie
Posts: 16
Joined: Sat Aug 26, 2006 10:18 pm

Post by cursed »

sorry about the first post, i was in a hurry.

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.


I hope I'm clear enough this time.
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

No idea, post some code.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I think we're going to need a lot more description and possibly your definitions of various terms you use.
cursed
Forum Newbie
Posts: 16
Joined: Sat Aug 26, 2006 10:18 pm

Post by cursed »

ok, 1 more time.
If a script is on a page, then it will show

Code: Select all

echo "Hello World";
If a script isn't on the page, then it will show this:

Code: Select all

echo "You need the script";
this time i hope i was clear..
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

What is your definition of a script?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Not exactly enough.

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?
cursed
Forum Newbie
Posts: 16
Joined: Sat Aug 26, 2006 10:18 pm

Post by cursed »

a PHP script...

but if this can be accomplished wit hsomething else, please let me no.
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

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.
cursed
Forum Newbie
Posts: 16
Joined: Sat Aug 26, 2006 10:18 pm

Post by cursed »

because im making this because of a affilate type script.

So i can verify if someone is acturally affilating or not.

yes, i know php doesnt exist on a page, and this script should have access to the "internals" of the said page.
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

How, as a human looking at the page, are you able to tell if a page features an affiliate?
cursed
Forum Newbie
Posts: 16
Joined: Sat Aug 26, 2006 10:18 pm

Post by cursed »

if it shows an image(affilate button) which is part of a script.

but i know how to do that, ijust need help with the above.
Post Reply