473,581 Members | 2,220 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

script help

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.

Sep 15 '06 #1
5 1417
hoozdiss wrote:
>
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.
You made two substantial mistakes.

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

e.g. <SCRIPT type="text/vbscript"
src="http://someplace.com/progs/vbcalc">

2) The <scripttag 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

<?php
include("/path/script.php");
?>

Bye!
Sep 15 '06 #2
On Fri, 15 Sep 2006 14:54:48 -0400, hoozdiss <Bi***@msn.comw rote:
>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>
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 :: an**@andyh.co.u k :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Sep 15 '06 #3
i'm trying to run scripts like site counters etc. right now i just
have small test scripts -

</head>

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

etc.
i keep the script files in the same directory as the html-
....Apache2.2\h tdocs\test
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).


Sep 15 '06 #4
hoozdiss wrote:
i'm trying to run scripts like site counters etc. right now i just
have small test scripts -

</head>

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

etc.
i keep the script files in the same directory as the html-
...Apache2.2\ht docs\test
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).

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.
js*******@attgl obal.net
=============== ===
Sep 15 '06 #5
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.
Sep 15 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
6537
by: dpackwood | last post by:
Hello, I have two different scripts that do pretty much the same thing. The main perl script is on Windows. It runs and in the middle of it, it then calls out another perl script that then should run on a Unix box I have. Both scripts run ok, except for the part when Windows try's to call out the Unix script. I have it set up where the Unix...
4
4170
by: hupjack | last post by:
I finally joined the millions of cell phone users out there. I'm the 2nd phone on what is now a family share plan. (Our two cell phones use minutes from a central 400 minute peak time pool.) Looking at the verizon wireless website, minutes used are displayed only as two different totals for our 2 phones. Dialing in from a phones to check...
14
2600
by: Akbar | last post by:
Hey there, Big-time curiosity issue here... Here's the test code (it's not that long)... it's to display a large number of image links with captions, ideally pulled in from an external file (that part's not here -- spotlighting the problem code): --------BEGIN CODE PAGE------------ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0...
8
4212
by: Johnny Knoxville | last post by:
I've added a favicon to my site (http://lazyape.filetap.com/) which works fine if you add the site to favourites the normal way, but I have some JavaScript code on a couple of pages with a link, which when you click it bookmarks the site (much easier). The favicon is never saved if the site is bookmarked this way. Does anyone have any ideas...
4
1795
by: Derek | last post by:
I have the following script in a page and it gets an error in IE 6. Says something about an invalid argument but the line number doesn't help since I can't see the javascript code when viewing source. I have this script in a popup page where the user selects a user ID (id) and that value is then placed into one of the parent window's form...
0
3218
by: ZMan | last post by:
Scenario: This is about debugging server side scripts that make calls to middle-tier business DLLs. The server side scripts are legacy ASP 3.0 pages, and the DLLs are managed DLLs converted/developed with VB.NET. What I want from debugging is to be able to step into the methods in the DLLs called from ASP scripts using Visual Studio .NET. ...
9
4903
by: Harry Smith | last post by:
While reading the documentation on IsStartupScriptRegistered, there is a reference to "client startup script" as "Determines if the client startup script is registered with the Page object." What is meant by "Client Start Script"? Thanks, Harry
3
3665
by: Angus | last post by:
I have a web page with a toolbar containing a Save button. The Save button can change contextually to be a Search button in some cases. Hence the button name searchsavechanges. The snippet of html is: <a class="searchsavechanges btn btn3d tbbtn" href="javascript:" style="position:static"> <div id="TBsearchsavechanges">Search</div> </a>
3
1726
by: David | last post by:
On Sun, May 4, 2008 at 4:43 AM, lev <levlozhkin@gmail.comwrote: Hi, I started tidying up the script a bit, but there are some parts I don't understand or look buggy. So I'm forwarding you the version I have so far. Look for the comments with my e-mail address in them for more information. If I have time I'll tidy up the script some more...
1
47429
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click on a link and after a moment or two a file download dialog box pops-up in your web browser and prompts you for some instructions, such as “open” or...
0
8149
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8304
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8175
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6553
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5674
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5364
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3827
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1403
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1138
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.