PHP and Javascript

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I have PHP 5 installed on my windows machine.  I have a drop down menu
that requires javascript.  When I call <?php include "filename.php" ?>
and rename my html file to .php, the Javascript doesn't run on the
client.  Is there some sort of setting required?  Maybe a bug in php?
Any information would be helpful.

Re: PHP and Javascript wrote:
Quoted text here. Click to load it
To be hones, i don't exactly know what you mean, but let me tell you:
PHP and JS are two very different things. PHP gets executed after the
server recieved the request. It then sends you a plain HTML document.
In that HTML document, the browser looks for initiation of JavaScripts.
So, if a javascript is not executed, this means you have something
wrong in your HTML or JavaScript code. It has nothing to do with PHP.
Try pasting your scripts.

Re: PHP and Javascript wrote:
Quoted text here. Click to load it

Pasting the scripts worked.  It's strange that SCRIPT html tag didn't
work with a PHP file under windows.

Re: PHP and Javascript

This should work fine.  View the source of the page after it has
loaded, and see if you can see the script tags that should be present. wrote:
Quoted text here. Click to load it

Re: PHP and Javascript

Quoted text here. Click to load it

Well you have to remember that the following:

<script language="php">
    echo 'Fred Flintstone';

is perfectly valid php syntax, script tag can be used instead of <?php ?>.  
Make sure you've got proper attributes in your script tag,  
type="text/javascript" language="javascript" so php won't mistake it for  

"Ohjelmoija  on  organismi  joka  muuttaa  kofeiinia  koodiksi" - lpk - Satunnaisesti pivittyv nettisarjis || Gedoon-S @ IRCnet || rot13(xvzzb@bhgbyrzcv.arg)  

Site Timeline