944,139 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 6942
  • PHP RSS
Jul 17th, 2007
0

php in <head>

Expand Post »
i am a newbie in learning php, and i would like to know if php can be used just as javascript being initialized in the head of an html docment to be called whenever you need it?
Similar Threads
Featured Poster
Reputation Points: 424
Solved Threads: 57
Posting Virtuoso
Nichito is offline Offline
1,594 posts
since Mar 2007
Jul 17th, 2007
0

Re: php in <head>

I don't think you can do that at all with PHP because it need to be processed by the PHP engine (server side).
Reputation Points: 27
Solved Threads: 14
Junior Poster
Cerberus is offline Offline
162 posts
since Sep 2006
Jul 17th, 2007
0

Re: php in <head>

so, when i write php, it must be written down in the body, so when loaded it is able to communicate with the server?

so php functions cannot be called when you need them?
Featured Poster
Reputation Points: 424
Solved Threads: 57
Posting Virtuoso
Nichito is offline Offline
1,594 posts
since Mar 2007
Jul 17th, 2007
0

Re: php in <head>

PHP is executed on the server, not in the browser. So it doesn't matter where you put it. If you want something executed in the browser you must use JavaScript.
Moderator
Reputation Points: 161
Solved Threads: 38
He's No Good To Me Dead
stymiee is offline Offline
1,422 posts
since May 2006
Jul 17th, 2007
0

Re: php in <head>

You can execute PHP in any part of your HTML page, for example witin the <head>
Reputation Points: 35
Solved Threads: 5
Junior Poster
dr4g is offline Offline
136 posts
since Apr 2007
Jul 19th, 2007
0

Re: php in <head>

You can look up AJAX, which is php functions executed on the fly by javascript.

That's probably what would work for you.
Reputation Points: 10
Solved Threads: 2
Newbie Poster
WhiteLeo is offline Offline
16 posts
since Feb 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: output error
Next Thread in PHP Forum Timeline: php and database





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC