script help

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

Threaded View
i installed apache 2.2 on winxp with php5.  when i write a piece of
html and include a php or java script in the html  i have no problem.
when i file the script and use something like  
<script  src="script.php"></script>
 i get nothing. he finds the file - if i rename it - he complains.
i'm guessing a config param.  please help.

Re: script help

hoozdiss wrote:
Quoted text here. Click to load it

You made two substantial mistakes.

1) If you use the HTML <script> tag you must tell the user agent which
language it is written in.

e.g. <SCRIPT type="text/vbscript"
src=" ">

2) The <script> tag is for client side scripting only! The server should
just pass the script to the user agent which should execute it.

If you want to include PHP scripts from a file use



Re: script help

Quoted text here. Click to load it

 That's specifying a client-side script to run, which is probably not what you
want (unless the PHP script is itself generating Javascript, for example).

 You probably want to use require() or similar in a PHP block.

Andy Hassall :: :: :: disk and FTP usage analysis tool

Re: script help

i'm trying to run scripts like site counters etc. right now i just
have small test scripts -


this is a test
<script type="text/javascript"
src=" "></script>
<br>and this<br>
<script src="http://localhost/test/calendar.php"></script>
try this-<br>
<script type="text/javascript" src="scriptJ.js"></script>
<script type="text/javascript">
document.write("this part works")
try include

i keep the script files in the same directory as the html-
if i delete them - there's a msg in the log so he knows they're there.

i don't know about using script type= javasript with php - am i
missing something here?  but even the js doesn't work (except the
inline one).

Re: script help

hoozdiss wrote:
Quoted text here. Click to load it

There is no difference between using a script tag in PHP and in HTML (as  
long as the tags aren't in a PHP block, of course).

First of all try getting it to work in a simple html page.  Once you get  
it to work there, it will work in this page.

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Re: script help

god - been working on this all day - finally found it - you can tell
i'm new to this.  my apache install was vanilla - i used htdocs for
initial testing then added a test directory under that which is where
i tested the scripts.  they didn't work until just now when i added
the test directory and "Options +Includes" to the httpd.conf file.
i really thought that was supposed to trickle down.  anyway thanks for
all offers of help.

Site Timeline