Subject: external php?...
Posted By: jman11587 Post Date: 1/30/2004 8:39:58 PM
hi, i am wonder if it is possible to have external php much like external javascript works:

<script language="javascript" src="blah.js"></script>

is there anything like this for php? i did some searching, but nothing made sense to me.

i am very new to php (i know my way around js and html tho) so try and keep it simple.

thank you for any help u can provide me with.
Reply By: reg03 Reply Date: 1/30/2004 8:45:47 PM
There is a major difference between javascript and php...javascript runs on the client and php runs on the server.  So, the answer to your question is no.

If you haven't already, visit http://www.php.net

R

Reply By: nikolai Reply Date: 1/30/2004 9:01:40 PM
Well, not necessarily.  The PHP interpreter will treat

<script language="php">...</script>

As

<?php ... ?>

So yes, you can include PHP code within <script> tags, but the browser will NEVER see these script tags, as they are removed by the PHP interpreter and replaced with whatever output PHP generates within those tags.

If you want to reference another PHP document, do this:

<script language="PHP">include("other_document.php");</script>


Take care,

Nik
http://www.bigaction.org/
Reply By: nikolai Reply Date: 1/30/2004 9:04:04 PM
For reference:
  http://www.php.net/basic-syntax#language.basic-syntax.phpmode


Take care,

Nik
http://www.bigaction.org/
Reply By: jman11587 Reply Date: 1/30/2004 11:54:56 PM
hey thanks a lot Nik.

i just tested it out and it works great, thanks again.

J


Go to topic 9148

Return to index page 958
Return to index page 957
Return to index page 956
Return to index page 955
Return to index page 954
Return to index page 953
Return to index page 952
Return to index page 951
Return to index page 950
Return to index page 949