Wrox Programmer Forums
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 30th, 2004, 09:39 PM
Registered User
 
Join Date: Jun 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default external php?...

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.
 
Old January 30th, 2004, 09:45 PM
Registered User
 
Join Date: Jan 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

 
Old January 30th, 2004, 10:01 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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/
 
Old January 30th, 2004, 10:04 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

For reference:
  http://www.php.net/basic-syntax#lang...syntax.phpmode


Take care,

Nik
http://www.bigaction.org/
 
Old January 31st, 2004, 12:54 AM
Registered User
 
Join Date: Jun 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hey thanks a lot Nik.

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

J






Similar Threads
Thread Thread Starter Forum Replies Last Post
External Directories doyle matt Apache Tomcat 0 October 19th, 2004 09:13 AM
Read external data rajanikrishna Classic ASP Databases 0 May 6th, 2004 03:24 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.