RE: [PHP] Include

2001-02-13 Thread Maxim Maletsky

You need to add a . (dot) to your include path in PHP.ini...

Cheers,
Maxim Maletsky



-Original Message-
From: Fabian Fabela [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 14, 2001 2:39 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Include


Hello,

I have php 4.0.3pl1.

I am trying to install phorum (phorum.org).

In a php file (index.php in admin) there is the function include for a file
(common.php), I get the following error.

Warning: Failed opening 'common.php' for inclusion
(include_path='/usr/share/php') in
/home/web/vacagorda/jeans/htdocs/foro/administration/index.php on line 28

Why I can't include that file without putting it in the /usr/shar/php
diretory?

Thank you

Fabian Fabela
[EMAIL PROTECTED]

"La información transmitida en el presente mensaje tiene la intención de
estar dirigida únicamente a la persona o entidad que se refiere y puede
contener información privilegiada y/o confidencial. Cualquier, revisión,
retransmisión, diseminación o cualquier uso impropio o relacionado con dicha
información por persona alguna distinta a la que fue dirigido este mensaje
queda estrictamente prohibido. Si Usted ha recibido  este mensaje o sus
anexos por error, favor de contactar al remitente y elimine el material de
cualquier computadora."

"The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material.  Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited.   If you received
this in error, please contact the sender and delete the material from any
computer."

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Include

2001-02-13 Thread Ankur Verma

you should try the setting for include_path in php.ini as

include_path =" /usr/share/php:./"


note the addition of './' in the include path.

this would allow php to include the files in the current directory as well,
which is the case I guess with the phorum scripts.

regards

best regards

Ankur Verma
HCL Technologies
A1CD, Sec -16
Noida, UP
India

- Original Message -
From: "Fabian Fabela" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 13, 2001 11:08 PM
Subject: [PHP] Include


Hello,

I have php 4.0.3pl1.

I am trying to install phorum (phorum.org).

In a php file (index.php in admin) there is the function include for a file
(common.php), I get the following error.

Warning: Failed opening 'common.php' for inclusion
(include_path='/usr/share/php') in
/home/web/vacagorda/jeans/htdocs/foro/administration/index.php on line 28

Why I can't include that file without putting it in the /usr/shar/php
diretory?

Thank you

Fabian Fabela
[EMAIL PROTECTED]

"La información transmitida en el presente mensaje tiene la intención de
estar dirigida únicamente a la persona o entidad que se refiere y puede
contener información privilegiada y/o confidencial. Cualquier, revisión,
retransmisión, diseminación o cualquier uso impropio o relacionado con dicha
información por persona alguna distinta a la que fue dirigido este mensaje
queda estrictamente prohibido. Si Usted ha recibido  este mensaje o sus
anexos por error, favor de contactar al remitente y elimine el material de
cualquier computadora."

"The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material.  Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited.   If you received
this in error, please contact the sender and delete the material from any
computer."



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] include!!!!!

2001-05-23 Thread mheumann

Hi,
that sounds like your Web server doesn't interpret PHP at all.  Are you sure you 
enabled it correctly?
What platform are you working on?
Greetings,
Michael.

> I'm new to php (having converted from the evil ASP) and i'm having some
> trouble with includes
>
> this is what i'm doing...
>
>  include("inc/db.inc.php")
>
> database stuff
>
> ?>
>
> db.inc.php is as follows:
> $linkID = mysql_connect('localhost', 'root', 'not-telling-you');
> mysql_select_db('foobar');
>
>
> All i get is the above outputted to the screen as html!
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


#
# Michael Heumann
# S&I Chile - Software e Informatica Limitada
# Arlegui 440, Of. 403, Viña del Mar, Chile
# Fonofax: (56)(32) 710833
# Email: [EMAIL PROTECTED]
# Web: http://www.softwareinformatica.cl
#

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Include

2001-08-07 Thread Johnson, Kirk

> I try to use include() and require() an that what i get:
> The path is 100% good.
> 
> Warning: Failed opening '../inc/menu.inc' for inclusion 
> (include_path='') in

Make sure that file permissions allow 'nobody' to view the file.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] 'include' & anchors

2002-01-20 Thread Bogdan Stancescu

"A script to go to an anchor" - I don't know about that... If you need a
_link_ to go to an anchor then you just need to echo the proper link
(i.e. echo "blah.htm#anchor";). If you want a script to _redirect_ to an
anchor then Emile is right: this is a client-side thing and you either
have to go with JavaScript or with a META tag. Anyway, include() is
definitely not the way to go.

Bogdan

Phil Schwarzmann wrote:

> I want a script to go to an anchor in an html page
>
> This doesn't seem to work
>
> include "blah.htm#anchor";
>
> how is this possible
>
> Thanks!
> Phil in baltimore
>
> P.S. Pittsburgh sucks Bill Gates' balls.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] include redirects

2002-01-29 Thread David Otton

On Tue, 29 Jan 2002 12:51:15 +0100, you wrote:

>Do you know a solution to insert remote content handling eventual redirects
>in the remote?
>Something like a browser.

fopen() the file you're trying to include, and handle the response
from the server yourself. If it returns 301 or 302, you have to find
the Location header, parse the URL out of it, and retry the fopen().

When you finally have a URL that returns 200 OK, include() it.

Having said that, I'd bet there's a class somewhere that will do the
response parsing for you.
http://php.resourceindex.com/Functions_and_Classes/Clients_and_Servers/HTTP/

Yes, this is a failing of the include() statement... it really should
handle HTTP response codes if it's going to do HTTP. I'm kinda
surprised it doesn't... are you certain?

djo


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] include() & .htaccess

2002-03-13 Thread Patrick Teague

I'm having problems with .htaccess files setting up the php_value
include_dir on both my development & test servers.  I'm using php4 under
apache on win2k for development & php4 under apache on unix as a test
server.  I've currently done the following on the win server


php_value include_dir ".;C:/home/plugged/common/"


& done the following on the unix server


php_value include_dir ".:/home/plugged/common/"


neither works...  am I doing something wrong here or am I forgetting
something?

Patrick



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] include() & .htaccess

2002-03-13 Thread Ford, Mike [LSS]

> -Original Message-
> From: Patrick Teague [mailto:[EMAIL PROTECTED]]
> Sent: 13 March 2002 10:48
> 
> 
> I'm having problems with .htaccess files setting up the php_value
> include_dir on both my development & test servers.  I'm using 
> php4 under
> apache on win2k for development & php4 under apache on unix as a test
> server.  I've currently done the following on the win server
> 
> 
> php_value include_dir ".;C:/home/plugged/common/"
> 
> 
> & done the following on the unix server
> 
> 
> php_value include_dir ".:/home/plugged/common/"
> 
> 
> neither works...  am I doing something wrong here or am I forgetting
> something?

Uh, well, including the name of the Directory you want it to apply to might be nice: 
just because the .htaccess file is in a particular directory doesn't mean that's used 
as the default -- you still have to specify it in full in the  tag.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] include() question

2002-03-14 Thread Demitrious S. Kelly

Try to simplify the problem
$file='index.php?var=';
$file.=$var;
include($file);

-Original Message-
From: Phil Schwarzmann [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, March 14, 2002 1:20 PM
To: [EMAIL PROTECTED]
Subject: [PHP] include() question

Why doesn't this work...
 
include("index.php?var='$var');
 
I want to include a page in my code and send a variable to it but I get
some funky error.
 
THANKS!!


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] include() question

2002-03-14 Thread Edward van Bilderbeek - Bean IT

you can't use a variable as a parameter for the included file... because
include does nothing else then putting the text of the include file on the
place of the include statement...

so this should work:

$var = 'bladibla';
include('index.php');


Greets,

Edward


- Original Message -
From: "Phil Schwarzmann" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 14, 2002 10:20 PM
Subject: [PHP] include() question


> Why doesn't this work...
>
> include("index.php?var='$var');
>
> I want to include a page in my code and send a variable to it but I get
> some funky error.
>
> THANKS!!
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] include() question

2002-03-14 Thread Erik Price


On Thursday, March 14, 2002, at 04:34  PM, Edward van Bilderbeek - Bean 
IT wrote:

> you can't use a variable as a parameter for the included file... because
> include does nothing else then putting the text of the include file on 
> the
> place of the include statement...

Are you sure about this?  I'm almost positive that PHP is flexible about 
accepting variables or strings as function arguments in most cases.  I 
just tested it, and it seems to work fine...

$includefile = './leftnavigation.inc';
include($includefile);

I posted a question on this list about a month ago, and someone said 
that you can use variables or strings in many cases -- just remember 
that the variable expands to the string BEFORE being processed by the 
function.

Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] include() question

2002-03-14 Thread Edward van Bilderbeek - Bean IT

Hmmm, now I'm in doubt... I always had errors using it, so I stopped using
it... I also have problems with variables that have the same name and are in
both the original file and the included file... might it have something to
do with the PHP version you're working on?

Greets,

Edward

- Original Message -
From: "Erik Price" <[EMAIL PROTECTED]>
To: "Edward van Bilderbeek - Bean IT" <[EMAIL PROTECTED]>
Cc: "Phil Schwarzmann" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, March 14, 2002 10:58 PM
Subject: Re: [PHP] include() question


>
> On Thursday, March 14, 2002, at 04:34  PM, Edward van Bilderbeek - Bean
> IT wrote:
>
> > you can't use a variable as a parameter for the included file... because
> > include does nothing else then putting the text of the include file on
> > the
> > place of the include statement...
>
> Are you sure about this?  I'm almost positive that PHP is flexible about
> accepting variables or strings as function arguments in most cases.  I
> just tested it, and it seems to work fine...
>
> $includefile = './leftnavigation.inc';
> include($includefile);
>
> I posted a question on this list about a month ago, and someone said
> that you can use variables or strings in many cases -- just remember
> that the variable expands to the string BEFORE being processed by the
> function.
>
> Erik
>
>
>
>
> 
>
> Erik Price
> Web Developer Temp
> Media Lab, H.H. Brown
> [EMAIL PROTECTED]
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] include() question

2002-03-14 Thread Edward van Bilderbeek - Bean IT

Jep, that was what I meant... sorry Erik, didn't read your question right...

Edward

- Original Message -
From: "Jan Rademaker" <[EMAIL PROTECTED]>
To: "Erik Price" <[EMAIL PROTECTED]>
Cc: "Edward van Bilderbeek - Bean IT" <[EMAIL PROTECTED]>; "Phil
Schwarzmann" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, March 14, 2002 11:03 PM
Subject: Re: [PHP] include() question


> On Thu, 14 Mar 2002, Erik Price wrote:
>
> >
> > On Thursday, March 14, 2002, at 04:34  PM, Edward van Bilderbeek - Bean
> > IT wrote:
> >
> > > you can't use a variable as a parameter for the included file...
because
> > > include does nothing else then putting the text of the include file on
> > > the
> > > place of the include statement...
> >
> > Are you sure about this?  I'm almost positive that PHP is flexible about
> > accepting variables or strings as function arguments in most cases.  I
> > just tested it, and it seems to work fine...
> >
> > $includefile = './leftnavigation.inc';
> > include($includefile);
> >
> I think what Edward means is that you can't pass parameters to an included
> file, like include("some.inc?var=value");
> That's true, at least for local
> files. include("http://remotesite/some.php?var=value";) will work, as long
> as remotesite has php installed, of course.
>
> --
> Jan Rademaker <[EMAIL PROTECTED]>
> http://www.ottobak.com
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] include() question

2002-03-14 Thread Erik Price


On Thursday, March 14, 2002, at 05:03  PM, Jan Rademaker wrote:

> I think what Edward means is that you can't pass parameters to an 
> included
> file, like include("some.inc?var=value");
> That's true, at least for local
> files. include("http://remotesite/some.php?var=value";) will work, as 
> long
> as remotesite has php installed, of course.

yes, a very clean way to do it (that I've used successfully) is 
something like:

$current_page = "User Login";
if ($badlogin) {
header("Location: http://domain.com/~eprice/badlogin.php?errormsg="; . 
$current_page);
}

This cleanly separates the string from the variable, but they are 
concatenated before being passed as an argument to the header() 
function.  This passes the name of the script as a querystring variable 
called $_GET['errormsg'], so that the receiving script can take some 
action based on where the user was sent from.


Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] include() question

2002-03-14 Thread Erik Price

Oh I see.  Sorry, i was thinking apples and you guys were talking about 
oranges.  I just ran into this problem a little while ago, that's why I 
felt the need to butt in.

Erik



On Thursday, March 14, 2002, at 05:08  PM, Edward van Bilderbeek - Bean 
IT wrote:

> Jep, that was what I meant... sorry Erik, didn't read your question 
> right...
>
> Edward
>
> - Original Message -
> From: "Jan Rademaker" <[EMAIL PROTECTED]>
> To: "Erik Price" <[EMAIL PROTECTED]>
> Cc: "Edward van Bilderbeek - Bean IT" <[EMAIL PROTECTED]>; "Phil
> Schwarzmann" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Thursday, March 14, 2002 11:03 PM
> Subject: Re: [PHP] include() question
>
>
>> On Thu, 14 Mar 2002, Erik Price wrote:
>>
>>>
>>> On Thursday, March 14, 2002, at 04:34  PM, Edward van Bilderbeek - 
>>> Bean
>>> IT wrote:
>>>
>>>> you can't use a variable as a parameter for the included file...
> because
>>>> include does nothing else then putting the text of the include file 
>>>> on
>>>> the
>>>> place of the include statement...
>>>
>>> Are you sure about this?  I'm almost positive that PHP is flexible 
>>> about
>>> accepting variables or strings as function arguments in most cases.  I
>>> just tested it, and it seems to work fine...
>>>
>>> $includefile = './leftnavigation.inc';
>>> include($includefile);
>>>
>> I think what Edward means is that you can't pass parameters to an 
>> included
>> file, like include("some.inc?var=value");
>> That's true, at least for local
>> files. include("http://remotesite/some.php?var=value";) will work, as 
>> long
>> as remotesite has php installed, of course.
>>
>> --
>> Jan Rademaker <[EMAIL PROTECTED]>
>> http://www.ottobak.com
>>
>>
>
>







Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] include() question

2002-03-14 Thread Lars Torben Wilson

On Thu, 2002-03-14 at 13:20, Phil Schwarzmann wrote:
> Why doesn't this work...
>  
> include("index.php?var='$var');
>  
> I want to include a page in my code and send a variable to it but I get
> some funky error.
>  
> THANKS!!

Please read this page carefully, especially the third paragraph and 
Examples 11.3 and 11.5: 

 http://www.php.net/manual/en/function.include.php

Hopefully that's help clear it up.

Essentially, you should be doing this:

  $var = 'someval';
  include('index.php');


Hope this helps,

Torben

-- 
 Torben Wilson <[EMAIL PROTECTED]>
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] include() question

2002-03-14 Thread Dave

Missing close " for one.
 v
include("index.php?var='$var'");
 ^
and you don't need to pass the $var to the include since it will be included,
and obviously you already have it declared.

if index.php contained


and the file you are in contained


then PHP reads this as


as such, no need to pass $var to the file since the file is included then
parsed.

Dave





>-Original Message-
>From: Phil Schwarzmann [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, March 14, 2002 4:20 PM
>To: [EMAIL PROTECTED]
>Subject: [PHP] include() question
>
>
>Why doesn't this work...
>
>include("index.php?var='$var');
>
>I want to include a page in my code and send a variable to it but I get
>some funky error.
>
>THANKS!!
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Include question

2002-06-01 Thread Bogdan Stancescu

Your second guess. But you could've tested it easily with two includes 
appending stuff to the same global var.

Bogdan

John Holmes wrote:

>Hi. When I've got code like the following:
> 
>if($this) { include("this.html"); }
>elseif($that) { include("that.html"); }
> 
>When are the includes() evaluated? Does the Zend engine do the includes
>first, pull in all of the code, then process it and produce output. Or
>does the engine start processing the code and only load the includes
>when it gets to them?
> 
>Thanks for any explanations.
> 
>---John Holmes.
>
>  
>




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Include question

2002-06-01 Thread John Holmes

The global var wouldn't work. Even if both are loaded into memory before
the script is ran, only one include will actually be executed along with
the code, so only one would end up affecting a global var either way. 

What I'm looking at is if each include .html file is 50K, am I loading
100K into memory and then running the script, or running the script and
only loading the appropriate 50K into memory when it's needed?

---John Holmes...

> -Original Message-
> From: Bogdan Stancescu [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, June 01, 2002 11:12 PM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Include question
> 
> Your second guess. But you could've tested it easily with two includes
> appending stuff to the same global var.
> 
> Bogdan
> 
> John Holmes wrote:
> 
> >Hi. When I've got code like the following:
> >
> >if($this) { include("this.html"); }
> >elseif($that) { include("that.html"); }
> >
> >When are the includes() evaluated? Does the Zend engine do the
includes
> >first, pull in all of the code, then process it and produce output.
Or
> >does the engine start processing the code and only load the includes
> >when it gets to them?
> >
> >Thanks for any explanations.
> >
> >---John Holmes.
> >
> >
> >
> 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Include question

2002-06-02 Thread Bogdan Stancescu

You're right, that wouldn't prove my point. However, you might try a 
little piece of code like the following:



I hope this proves that includes are included at runtime because PHP 
wouldn't know what $b and $c are beforehand. Apart from that, I'm 
positive I read about it in a man page, but can't recall which, that's 
why I didn't direct you to it ;-)

Bogdan

John Holmes wrote:

>The global var wouldn't work. Even if both are loaded into memory before
>the script is ran, only one include will actually be executed along with
>the code, so only one would end up affecting a global var either way. 
>
>What I'm looking at is if each include .html file is 50K, am I loading
>100K into memory and then running the script, or running the script and
>only loading the appropriate 50K into memory when it's needed?
>
>---John Holmes...
>
>  
>
>>-Original Message-
>>From: Bogdan Stancescu [mailto:[EMAIL PROTECTED]]
>>Sent: Saturday, June 01, 2002 11:12 PM
>>To: [EMAIL PROTECTED]
>>Cc: [EMAIL PROTECTED]
>>Subject: Re: [PHP] Include question
>>
>>Your second guess. But you could've tested it easily with two includes
>>appending stuff to the same global var.
>>
>>Bogdan
>>
>>John Holmes wrote:
>>
>>
>>
>>>Hi. When I've got code like the following:
>>>
>>>if($this) { include("this.html"); }
>>>elseif($that) { include("that.html"); }
>>>
>>>When are the includes() evaluated? Does the Zend engine do the
>>>  
>>>
>includes
>  
>
>>>first, pull in all of the code, then process it and produce output.
>>>  
>>>
>Or
>  
>
>>>does the engine start processing the code and only load the includes
>>>when it gets to them?
>>>
>>>Thanks for any explanations.
>>>
>>>---John Holmes.
>>>
>>>
>>>
>>>  
>>>
>
>
>
>  
>




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Include question

2002-06-02 Thread Analysis & Solutions

Hey John:

On Sun, Jun 02, 2002 at 12:10:27AM -0400, John Holmes wrote:
> 
> What I'm looking at is if each include .html file is 50K, am I loading
> 100K into memory and then running the script, or running the script and
> only loading the appropriate 50K into memory when it's needed?

As of 4.0.2, stuff is only loaded when it's needed.  So, in your 
example, only 50k is brought in.

Note, this is yet another case where it pays for me to read the manual
before posting!  I was still thinking in the old way, where include() 
was conditional and require() was always done.

Ciao!

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Include question

2002-06-11 Thread John Holmes

Umm...that's what it's supposed to do...it's "including" it...

---John Holmes...

> -Original Message-
> From: Tom Ray [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 11, 2002 9:29 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Include question
> 
> I'm trying to use the include function in some PHP scripts, but when I
do
> 
> include 'config.inc'; or include 'config.php;
> 
> It returns all the information in the file when I look at my test php
> file (which calls the include) Anyone know why this is?
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Include question

2002-06-11 Thread Tom Ray

Yes, but according to http://www.php.net/manual/en/function.include.php 
I should be able to delcare the include and then pull the information 
out normally. So by what the manual says I can do this

somefile.php


callfile.php


But when I just do



It prints:
$apple = 'green'; $pear = 'yellow':


Why is that?


John Holmes wrote:

>Umm...that's what it's supposed to do...it's "including" it...
>
>---John Holmes...
>
>  
>
>>-Original Message-
>>From: Tom Ray [mailto:[EMAIL PROTECTED]]
>>Sent: Tuesday, June 11, 2002 9:29 PM
>>To: [EMAIL PROTECTED]
>>Subject: [PHP] Include question
>>
>>I'm trying to use the include function in some PHP scripts, but when I
>>
>>
>do
>  
>
>>include 'config.inc'; or include 'config.php;
>>
>>It returns all the information in the file when I look at my test php
>>file (which calls the include) Anyone know why this is?
>>
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
>
>.
>
>  
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Include question

2002-06-11 Thread Justin French

Check that you actually have  wrapped around the PHP code in
somefile.php that you include.

Justin French


on 12/06/02 11:36 AM, Tom Ray ([EMAIL PROTECTED]) wrote:

> Yes, but according to http://www.php.net/manual/en/function.include.php
> I should be able to delcare the include and then pull the information
> out normally. So by what the manual says I can do this
> 
> somefile.php
>  $apple = 'green';
> $pear = 'yellow';
> ?>
> 
> callfile.php
>  include 'somefile.php';
> echo "Apples are $apple and Pears are $pear"; \\ which would return the
> line with green and yellow in the correct spots.
> ?>
> 
> But when I just do
> 
>  include 'somefile.php';
> ?>
> 
> It prints:
> $apple = 'green'; $pear = 'yellow':
> 
> 
> Why is that?
> 
> 
> John Holmes wrote:
> 
>> Umm...that's what it's supposed to do...it's "including" it...
>> 
>> ---John Holmes...
>> 
>> 
>> 
>>> -Original Message-
>>> From: Tom Ray [mailto:[EMAIL PROTECTED]]
>>> Sent: Tuesday, June 11, 2002 9:29 PM
>>> To: [EMAIL PROTECTED]
>>> Subject: [PHP] Include question
>>> 
>>> I'm trying to use the include function in some PHP scripts, but when I
>>> 
>>> 
>> do
>> 
>> 
>>> include 'config.inc'; or include 'config.php;
>>> 
>>> It returns all the information in the file when I look at my test php
>>> file (which calls the include) Anyone know why this is?
>>> 
>>> 
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>> 
>>> 
>> 
>> 
>> .
>> 
>> 
>> 
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Include question

2002-06-11 Thread Peter

Tom,

just did ur test on win2k php 4.2.1 with apache and when i just did .. 



i get a blank screen as I should

the only way you should be getting anything is by calling the values...

-Original Message-
From: Tom Ray [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 12 June 2002 11:36 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Include question


Yes, but according to http://www.php.net/manual/en/function.include.php 
I should be able to delcare the include and then pull the information 
out normally. So by what the manual says I can do this

somefile.php


callfile.php


But when I just do



It prints:
$apple = 'green'; $pear = 'yellow':


Why is that?


John Holmes wrote:

>Umm...that's what it's supposed to do...it's "including" it...
>
>---John Holmes...
>
>  
>
>>-Original Message-
>>From: Tom Ray [mailto:[EMAIL PROTECTED]]
>>Sent: Tuesday, June 11, 2002 9:29 PM
>>To: [EMAIL PROTECTED]
>>Subject: [PHP] Include question
>>
>>I'm trying to use the include function in some PHP scripts, but when I
>>
>>
>do
>  
>
>>include 'config.inc'; or include 'config.php;
>>
>>It returns all the information in the file when I look at my test php
>>file (which calls the include) Anyone know why this is?
>>
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
>
>.
>
>  
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Include question

2002-06-11 Thread Tom Ray

Well I got it solved. It would help if I formatted my files correctly.

Sorry about that, i've been messing with PHP for about a year now, but 
am now really diving into it so I may have stupid questions here and 
there :)

TIA to all for help.

John Holmes wrote:

>Umm...that's what it's supposed to do...it's "including" it...
>
>---John Holmes...
>
>  
>
>>-Original Message-
>>From: Tom Ray [mailto:[EMAIL PROTECTED]]
>>Sent: Tuesday, June 11, 2002 9:29 PM
>>To: [EMAIL PROTECTED]
>>Subject: [PHP] Include question
>>
>>I'm trying to use the include function in some PHP scripts, but when I
>>
>>
>do
>  
>
>>include 'config.inc'; or include 'config.php;
>>
>>It returns all the information in the file when I look at my test php
>>file (which calls the include) Anyone know why this is?
>>
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
>
>  
>




RE: [PHP] Include question

2002-06-11 Thread David Freeman


 > somefile.php
 >  $apple = 'green';
 > $pear = 'yellow';
 > ?>
 > 
 > callfile.php
 >  include 'somefile.php';
 > echo "Apples are $apple and Pears are $pear"; \\ which would 
 > return the 
 > line with green and yellow in the correct spots.
 > ?>
 > 
 > But when I just do
 > 
 >  include 'somefile.php';
 > ?>
 > 
 > It prints:
 > $apple = 'green'; $pear = 'yellow':

Looks to me like your include file isn't being interpreted as php for
some reason.  Is the information here your exact test case or is it
different.  Certainly, as you've got it here, it would work - at least
it does for the numerous php projects I've done.

CYA, Dave

--
--
Outback Queensland Internet   
Longreach ** New Web Site Online *
Queensland
Australia W: www.outbackqld.net.au




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Include/require

2002-06-20 Thread Michael Sweeney

Be careful not to get confused between a chrooted environment like the
web server or ftp server and php include paths. PHP handles the include
and require parameters either as absolute (eg /inc/filename is an
absolute path from / - it is not relative to the web docroot.) or
relative to the directories in the php.ini include directive. If you
want to simplify your include and require statements, specify the path
to 'inc' in php.ini and then express the paths to the included files
relative to that.

..michael..

On Wed, 2002-06-19 at 22:43, David Freeman wrote:
> 
>  > Is there a way to make include()/require() take a a full
>  > virtual path?  I.e.  require_once("/inc/myinc.php")?  It gets
>  > a little annoying to do require("../../../../file.php").
> 
> Sure, they should work either way.  The only real gotcha is knowing what
> a full path will be in relation to the web server when it goes to do the
> include/require.  For example, an include for '/inc/myinc.php' has
> particular meaning under *nix that may have it not work even though it
> looks that way to an ftp proggy.
> 
> Part of my normal configuration file for php projects is a declaration
> of $webroot as the path to a document as called from within a browser
> (ie. $webroot = "http://www.some.domain/some/directory";) and $fileroot
> as the path to a document as called from the filesystem (ie. $fileroot =
> "/home/some/user/directory") and then just append as appropriate (ie.
> Include($fileroot/inc/someinclude.php) and away you go.
> 
> CYA, Dave
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] include() question...

2002-06-20 Thread Purushotham Komaravolu

use header
ob_start()
$temp = "website.php?var=".$var;
header ("Location: $temp");


Puru
- Original Message - 
From: "Phil Schwarzmann" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 20, 2002 4:31 PM
Subject: [PHP] include() question...


> Okay, let's say I want to send a user to a certain webpage...
> 
> usually I would use...
> 
> include("website.php");
> 
> but, if i want to send a user to a website along with a variable like...
> 
> $temp = "website.php?var=".$var;
> include($temp);
> 
> ...this doesn't work.  
> 
> any suggestions??
> 
> THANKS!!
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] include() question...

2002-06-20 Thread Philip Olson


> but, if i want to send a user to a website along 
> with a variable like...
> 
> $temp = "website.php?var=".$var;
> include($temp);
> 
> ...this doesn't work.  

Example:



somefile.php now has access to $var.  This is 
talked about in the manual too:

  http://www.php.net/include

In your case above, $var will already be available 
to website.php if you simply include it.

Regards,
Philip Olson


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] include() question...

2002-06-20 Thread David Freeman


 > Okay, let's say I want to send a user to a certain webpage...
 > 
 > usually I would use...
 > 
 > include("website.php");
 > 
 > but, if i want to send a user to a website along with a 
 > variable like...
 > 
 > $temp = "website.php?var=".$var;
 > include($temp);
 > 
 > ...this doesn't work.  

If you are just including the file in what's already loading then all
you need to do is make sure that $var is already set when you include
the file.  Including is logically the same as opening up the other file
and then doing a copy/paste into the current page.  It's exactly the
same as if the contents of your included file was in the file that's
doing the including.

If you are actually trying to load a new page and pass a variable to it
then you probably want to look at using header("Location:
website.php?var=$var"); instead.  This will actually load a whole new
page in the browser rather than just including an extra file in a page
that's already being loaded.

CYA, Dave



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] include() problem.

2001-10-23 Thread David Robley

On Wed, 24 Oct 2001 08:03, brendan wrote:
> Hi,
>   I have an issue with including a file accross my web server from a
> separate site on that server served on another port.
>
> - explanation
>
> my php website runs off IIS port :80 (unfortunately IIS is employers
> decision not mine )
> - I have a web spider running off port :
> both which operate independent of eachother and serve content
> separately ..
>
> I am within a secure firewall (a university)
>
> the network administration is understandably cautious about microsoft
> security and has now blocked all ports but :80 on IIS machines ...
>
> - outcome
>
> i cannot serve web content from port :
> however the spider cannot run simultaneously to IIS on the same port..
>
> - proposed solution ..
>
> to use
> include("http://localhost:/spider/index.html?query=ihateIIS";)
>
> outcome - blank screen, headache from staring at screen too long ..
>
> HELP!!!

I guess first question is - does View Source show you anything?

Isn't it wonderful how unis, of all places, insist on running stuff like 
IIS? 

-- 
David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA  

   Smile... people will wonder what you've been up to.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] include() problem.

2001-10-23 Thread brendan

Uni runs solaris/unix
faculty runs iis
world of political pain and anguish..

view source brings up a blank screen ..
ta
brendan

David Robley wrote:

> On Wed, 24 Oct 2001 08:03, brendan wrote:
> 
>>Hi,
>>  I have an issue with including a file accross my web server from a
>>separate site on that server served on another port.
>>
>>- explanation
>>
>>my php website runs off IIS port :80 (unfortunately IIS is employers
>>decision not mine )
>>- I have a web spider running off port :
>>both which operate independent of eachother and serve content
>>separately ..
>>
>>I am within a secure firewall (a university)
>>
>>the network administration is understandably cautious about microsoft
>>security and has now blocked all ports but :80 on IIS machines ...
>>
>>- outcome
>>
>>i cannot serve web content from port :
>>however the spider cannot run simultaneously to IIS on the same port..
>>
>>- proposed solution ..
>>
>>to use
>>include("http://localhost:/spider/index.html?query=ihateIIS";)
>>
>>outcome - blank screen, headache from staring at screen too long ..
>>
>>HELP!!!
>>
> 
> I guess first question is - does View Source show you anything?
> 
> Isn't it wonderful how unis, of all places, insist on running stuff like 
> IIS? 
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] include() problem.

2001-10-23 Thread David Robley

On Wed, 24 Oct 2001 10:02, brendan wrote:
> Uni runs solaris/unix
> faculty runs iis
> world of political pain and anguish..
>
> view source brings up a blank screen ..
> ta
> brendan
>

OK - bit of straw grasping; you do have URL-fopen-wrappers enabled; try 
assigning the result of the include to a variable and examine the 
variable; try including just the base file without parameters; are the 
logs on the target system showing naything as a result of your connect?

-- 
David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA  

   The first step to making a dream come true is to wake up

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Include files

2001-02-12 Thread Alexander Wagner

Conover, Ryan wrote:
> I have an include file foo.inc.  I want to call a function that is in
> another include file,say anotherfoo.inc, from the foo.inc.

[..]

> can I call an include from another include?

Sure.

> I tried the above but it fails opening the other include.
>
> Should I have the
> '  "include"c:\\...\\anotherfoo.inc"  '
> in the file that includes the Foo.inc?

No, you can include what and where you want (provided it's valid PHP), 
but if you use relative paths, the paths all have to be relativ to the 
original file, the file that is called by the browser (or whatever you 
use to call your scripts).

regards
Wagner

-- 
Three may keep a secret, if two of them are dead.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Include files

2001-02-12 Thread PHPBeginner.com

Yes, you can include foo.php which has another include in it and another and
another    they will all appear to you as a one single file.

But, be careful though, do not reinclude them, or you'll create an infinite
loop.. use include_once instead


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-Original Message-
From: Conover, Ryan [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 13, 2001 1:46 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Include files


I have an include file foo.inc.  I want to call a function that is in
another include file,say anotherfoo.inc, from the foo.inc.

//Foo.inc

include "c:\\...\\anotherfoo.inc";

//other code

//end of include

can I call an include from another include?

I tried the above but it fails opening the other include.

Should I have the
'  "include"c:\\...\\anotherfoo.inc"  '
in the file that includes the Foo.inc?

ryan

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] include file

2001-02-25 Thread David Robley

On Mon, 26 Feb 2001 13:29, JW wrote:
> I have created a config.php3 to store the connection of the database
> and some constant variable. Then, I created the other file
> functions.php3 and inculde config.php3 into this file for
> function.phps3 should use some variables inside the file config.php3.
> However, I don't know why all the variable cannot display in the
> function.php3.
>
> would anyone please to tell me what is the reason and how I can solve
> it?

You may need to declare the variables global within the function, or pass 
them as arguments to the function.

-- 
David Robley| WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet| http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] include() & require()

2001-03-07 Thread Derek Sivers


>Which is the main difference between include() and
>require() functions?


"include" is optional
you can put it inside an "IF"
like this:

if (0)
   {
   /* THIS WILL NOT SHOW... */
   include "optional_file.php";
   }


but "require" happens every time,
even if it is inside an "IF" that does not happen.

if (0)
   {
   /* THIS WILL SHOW ANYWAY... */
   require "optional_file.php";
   }


Me personally,
I use "require" to include functions, libraries, classes that I NEED to run 
the page.
Then I use "include" for optional things, based on "if".





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] include() & require()

2001-03-07 Thread Zeev Suraski

At 13:41 7/3/2001, Derek Sivers wrote:

>>Which is the main difference between include() and
>>require() functions?
>
>
>"include" is optional
>you can put it inside an "IF"
>like this:
>
>if (0)
>   {
>   /* THIS WILL NOT SHOW... */
>   include "optional_file.php";
>   }
>
>
>but "require" happens every time,
>even if it is inside an "IF" that does not happen.
>
>if (0)
>   {
>   /* THIS WILL SHOW ANYWAY... */
>   require "optional_file.php";
>   }


That's actually no longer true, in more recent versions of PHP (it used to 
be true).  The only difference between include() and require() is that 
require() will bail out if it fails, whereas include() would not.

Zeev


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] include statement

2001-01-17 Thread Adam Wright

This is because the PHP include statement is ment to include other blocks of
PHP code, rather than bits of HTML. Hence, it includes things from anywhere
on the system. To include things from under your current htdocs directory,
use...

include($DOCUMENT_ROOT . "/includes/metatags.include");

though the more 'correct' method would be

readfile($DOCUMENT_ROOT . "/includes/metatags.include");

adamw

- Original Message -
From: "Michael Zornek" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 17, 2001 5:04 PM
Subject: [PHP] include statement


> I'm a PHP newbie and am looking into using the include statement to
> put things like the header and footer in so they are always the same.
>
> I do this now with SSI. In SSI I'll use the following statement:
>
> 
>
> I like this cause it lets me use the same statement all over the site
> and I don't have to worry about where the document is and how many
> directories i have to go up an into "../../../../../"
>
> I was guessing PHP's version would be:
>
>  include("/includes/metatags.include");
> ?>
>
> However I get an error. If I put the absolute it works:
>
>  include("/home/httpd/includes/metatags.include");
> ?>
>
> which is scary cause this worked too:
>
>  include("/usr/local/apache/conf/httpd.conf");
> ?>
>
> doesn't this seem like a huge security hole?
>
> Well what I want is to use something like /inc/footer.html so i can
> use the same PHP statements in any document and not worry about
> getting it "../../../"
>
> Any suggestions.
> Mike
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] include statement

2001-01-17 Thread Toby Butzon

This all depends on your include_path set in the PHP config files; see the
manual section on config for more info.

About the security hole... yes it would be dangerous on a system where
accounts are given to untrusted users (ie, customers), but there are ways
to make PHP secure for multi-account environments as well; this is also is
described in the manual.

php.net/manual

--Toby

- Original Message -
From: "Michael Zornek" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 17, 2001 12:04 PM
Subject: [PHP] include statement


> I'm a PHP newbie and am looking into using the include statement to
> put things like the header and footer in so they are always the same.
>
> I do this now with SSI. In SSI I'll use the following statement:
>
> 
>
> I like this cause it lets me use the same statement all over the site
> and I don't have to worry about where the document is and how many
> directories i have to go up an into "../../../../../"
>
> I was guessing PHP's version would be:
>
>  include("/includes/metatags.include");
> ?>
>
> However I get an error. If I put the absolute it works:
>
>  include("/home/httpd/includes/metatags.include");
> ?>
>
> which is scary cause this worked too:
>
>  include("/usr/local/apache/conf/httpd.conf");
> ?>
>
> doesn't this seem like a huge security hole?
>
> Well what I want is to use something like /inc/footer.html so i can
> use the same PHP statements in any document and not worry about
> getting it "../../../"
>
> Any suggestions.
> Mike
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] include statement

2001-01-17 Thread Alexander Wagner

Michael Zornek wrote:
> which is scary cause this worked too:
>
>  include("/usr/local/apache/conf/httpd.conf");
> ?>
>
> doesn't this seem like a huge security hole?

No. If you know can trust your scripts, this is possible, but trusted scripts 
won't do any abuse, will they?
If you can't trust your scripts, use safe-mode, and it isn't possible any 
more.

Wagner

-- 
One maniac alone can do what 20 together cannot

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] include statement

2001-01-17 Thread Michael Zornek

Adam(and everyone else who answers in 5 minutes, god i love this list),

thanks for the help.

Why is readfile more 'correct'?

Just wondering?
Mike

At 5:07 PM + 1/17/01, Adam Wright wrote:
>This is because the PHP include statement is ment to include other blocks of
>PHP code, rather than bits of HTML. Hence, it includes things from anywhere
>on the system. To include things from under your current htdocs directory,
>use...
>
>include($DOCUMENT_ROOT . "/includes/metatags.include");
>
>though the more 'correct' method would be
>
>readfile($DOCUMENT_ROOT . "/includes/metatags.include");
>
>adamw
>
>- Original Message -
>From: "Michael Zornek" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Wednesday, January 17, 2001 5:04 PM
>Subject: [PHP] include statement
>
>
>>  I'm a PHP newbie and am looking into using the include statement to
>>  put things like the header and footer in so they are always the same.
>>
>>  I do this now with SSI. In SSI I'll use the following statement:
>>
>>  
>>
>>  I like this cause it lets me use the same statement all over the site
>>  and I don't have to worry about where the document is and how many
>>  directories i have to go up an into "../../../../../"
>>
>>  I was guessing PHP's version would be:
>>
>>  >  include("/includes/metatags.include");
>>  ?>
>>
>>  However I get an error. If I put the absolute it works:
>>
>>  >  include("/home/httpd/includes/metatags.include");
>>  ?>
>>
>>  which is scary cause this worked too:
>>
>>  >  include("/usr/local/apache/conf/httpd.conf");
>>  ?>
>>
>>  doesn't this seem like a huge security hole?
>>
>>  Well what I want is to use something like /inc/footer.html so i can
>>  use the same PHP statements in any document and not worry about
>>  getting it "../../../"
>>
>>  Any suggestions.
>>  Mike
>>
>>
>>  --
>>  PHP General Mailing List (http://www.php.net/)
>>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>>  For additional commands, e-mail: [EMAIL PROTECTED]
>>  To contact the list administrators, e-mail: [EMAIL PROTECTED]
>>
>>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] include statement

2001-01-17 Thread Adam Wright

For your things (where you are including HTML), readfile just reads a file
and dumps it to the screen. This is fine, because you are just dealing with
HTML, so no processing is required. include will actually try and parse the
file as if it has PHP inside somewhere, which your HTML (probably) doesnt.
So, readfile uses less resources, and is much more like the SSI include
statement than PHP's include :)

adamw

- Original Message -
From: "Michael Zornek" <[EMAIL PROTECTED]>
To: "Adam Wright" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, January 17, 2001 5:14 PM
Subject: Re: [PHP] include statement


> Adam(and everyone else who answers in 5 minutes, god i love this list),
>
> thanks for the help.
>
> Why is readfile more 'correct'?
>
> Just wondering?
> Mike
>
> At 5:07 PM + 1/17/01, Adam Wright wrote:
> >This is because the PHP include statement is ment to include other blocks
of
> >PHP code, rather than bits of HTML. Hence, it includes things from
anywhere
> >on the system. To include things from under your current htdocs
directory,
> >use...
> >
> >include($DOCUMENT_ROOT . "/includes/metatags.include");
> >
> >though the more 'correct' method would be
> >
> >readfile($DOCUMENT_ROOT . "/includes/metatags.include");
> >
> >adamw
> >
> >- Original Message -
> >From: "Michael Zornek" <[EMAIL PROTECTED]>
> >To: <[EMAIL PROTECTED]>
> >Sent: Wednesday, January 17, 2001 5:04 PM
> >Subject: [PHP] include statement
> >
> >
> >>  I'm a PHP newbie and am looking into using the include statement to
> >>  put things like the header and footer in so they are always the same.
> >>
> >>  I do this now with SSI. In SSI I'll use the following statement:
> >>
> >>  
> >>
> >>  I like this cause it lets me use the same statement all over the site
> >>  and I don't have to worry about where the document is and how many
> >>  directories i have to go up an into "../../../../../"
> >>
> >>  I was guessing PHP's version would be:
> >>
> >>   >>  include("/includes/metatags.include");
> >>  ?>
> >>
> >>  However I get an error. If I put the absolute it works:
> >>
> >>   >>  include("/home/httpd/includes/metatags.include");
> >>  ?>
> >>
> >>  which is scary cause this worked too:
> >>
> >>   >>  include("/usr/local/apache/conf/httpd.conf");
> >>  ?>
> >>
> >>  doesn't this seem like a huge security hole?
> >>
> >>  Well what I want is to use something like /inc/footer.html so i can
> >>  use the same PHP statements in any document and not worry about
> >>  getting it "../../../"
> >>
> >>  Any suggestions.
> >>  Mike
> >>
> >>
> >>  --
> >>  PHP General Mailing List (http://www.php.net/)
> >>  To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>  For additional commands, e-mail: [EMAIL PROTECTED]
> >>  To contact the list administrators, e-mail:
[EMAIL PROTECTED]
> >>
> >>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] include statement

2001-01-17 Thread Karl J. Stubsjoen

What about the security issue mentioned?  Is it then possible (using the
include and/or readfile) to grab anything found on the server?
1 More thing:  what if I wanted to place the contents of a file into a
variable.  How do you achieve that?

Karl *also a newbie, and this is a great group*




- Original Message -
From: "Adam Wright" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; "Michael Zornek"
<[EMAIL PROTECTED]>
Sent: Wednesday, January 17, 2001 10:18 AM
Subject: Re: [PHP] include statement


> For your things (where you are including HTML), readfile just reads a file
> and dumps it to the screen. This is fine, because you are just dealing
with
> HTML, so no processing is required. include will actually try and parse
the
> file as if it has PHP inside somewhere, which your HTML (probably) doesnt.
> So, readfile uses less resources, and is much more like the SSI include
> statement than PHP's include :)
>
> adamw
>
> - Original Message -
> From: "Michael Zornek" <[EMAIL PROTECTED]>
> To: "Adam Wright" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Wednesday, January 17, 2001 5:14 PM
> Subject: Re: [PHP] include statement
>
>
> > Adam(and everyone else who answers in 5 minutes, god i love this list),
> >
> > thanks for the help.
> >
> > Why is readfile more 'correct'?
> >
> > Just wondering?
> > Mike
> >
> > At 5:07 PM + 1/17/01, Adam Wright wrote:
> > >This is because the PHP include statement is ment to include other
blocks
> of
> > >PHP code, rather than bits of HTML. Hence, it includes things from
> anywhere
> > >on the system. To include things from under your current htdocs
> directory,
> > >use...
> > >
> > >include($DOCUMENT_ROOT . "/includes/metatags.include");
> > >
> > >though the more 'correct' method would be
> > >
> > >readfile($DOCUMENT_ROOT . "/includes/metatags.include");
> > >
> > >adamw
> > >
> > >- Original Message -
> > >From: "Michael Zornek" <[EMAIL PROTECTED]>
> > >To: <[EMAIL PROTECTED]>
> > >Sent: Wednesday, January 17, 2001 5:04 PM
> > >Subject: [PHP] include statement
> > >
> > >
> > >>  I'm a PHP newbie and am looking into using the include statement to
> > >>  put things like the header and footer in so they are always the
same.
> > >>
> > >>  I do this now with SSI. In SSI I'll use the following statement:
> > >>
> > >>  
> > >>
> > >>  I like this cause it lets me use the same statement all over the
site
> > >>  and I don't have to worry about where the document is and how many
> > >>  directories i have to go up an into "../../../../../"
> > >>
> > >>  I was guessing PHP's version would be:
> > >>
> > >>   > >>  include("/includes/metatags.include");
> > >>  ?>
> > >>
> > >>  However I get an error. If I put the absolute it works:
> > >>
> > >>   > >>  include("/home/httpd/includes/metatags.include");
> > >>  ?>
> > >>
> > >>  which is scary cause this worked too:
> > >>
> > >>   > >>  include("/usr/local/apache/conf/httpd.conf");
> > >>  ?>
> > >>
> > >>  doesn't this seem like a huge security hole?
> > >>
> > >>  Well what I want is to use something like /inc/footer.html so i can
> > >>  use the same PHP statements in any document and not worry about
> > >>  getting it "../../../"
> > >>
> > >>  Any suggestions.
> > >>  Mike
> > >>
> > >>
> > >>  --
> > >>  PHP General Mailing List (http://www.php.net/)
> > >>  To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >>  For additional commands, e-mail: [EMAIL PROTECTED]
> > >>  To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> > >>
> > >>
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] include statement

2001-01-17 Thread Adam Wright

Pretty much, yes (within the bounds of the permissions of the files. Most
webservers run as nobody on unix, and hence can only read those files which
nobody can (confusing, huh :)). But, unless you have a mallicious user with
upload access to your server, this isnt an issue. If you do, investigate
"Safe mode" this instant :)

adamw

- Original Message -
From: "Karl J. Stubsjoen" <[EMAIL PROTECTED]>
To: "Adam Wright" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>;
"Michael Zornek" <[EMAIL PROTECTED]>
Sent: Wednesday, January 17, 2001 5:21 PM
Subject: Re: [PHP] include statement


> What about the security issue mentioned?  Is it then possible (using the
> include and/or readfile) to grab anything found on the server?
> 1 More thing:  what if I wanted to place the contents of a file into a
> variable.  How do you achieve that?
>
> Karl *also a newbie, and this is a great group*
>
>
>
>
> - Original Message -
> From: "Adam Wright" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>; "Michael Zornek"
> <[EMAIL PROTECTED]>
> Sent: Wednesday, January 17, 2001 10:18 AM
> Subject: Re: [PHP] include statement
>
>
> > For your things (where you are including HTML), readfile just reads a
file
> > and dumps it to the screen. This is fine, because you are just dealing
> with
> > HTML, so no processing is required. include will actually try and parse
> the
> > file as if it has PHP inside somewhere, which your HTML (probably)
doesnt.
> > So, readfile uses less resources, and is much more like the SSI include
> > statement than PHP's include :)
> >
> > adamw
> >
> > - Original Message -
> > From: "Michael Zornek" <[EMAIL PROTECTED]>
> > To: "Adam Wright" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> > Sent: Wednesday, January 17, 2001 5:14 PM
> > Subject: Re: [PHP] include statement
> >
> >
> > > Adam(and everyone else who answers in 5 minutes, god i love this
list),
> > >
> > > thanks for the help.
> > >
> > > Why is readfile more 'correct'?
> > >
> > > Just wondering?
> > > Mike
> > >
> > > At 5:07 PM + 1/17/01, Adam Wright wrote:
> > > >This is because the PHP include statement is ment to include other
> blocks
> > of
> > > >PHP code, rather than bits of HTML. Hence, it includes things from
> > anywhere
> > > >on the system. To include things from under your current htdocs
> > directory,
> > > >use...
> > > >
> > > >include($DOCUMENT_ROOT . "/includes/metatags.include");
> > > >
> > > >though the more 'correct' method would be
> > > >
> > > >readfile($DOCUMENT_ROOT . "/includes/metatags.include");
> > > >
> > > >adamw
> > > >
> > > >- Original Message -
> > > >From: "Michael Zornek" <[EMAIL PROTECTED]>
> > > >To: <[EMAIL PROTECTED]>
> > > >Sent: Wednesday, January 17, 2001 5:04 PM
> > > >Subject: [PHP] include statement
> > > >
> > > >
> > > >>  I'm a PHP newbie and am looking into using the include statement
to
> > > >>  put things like the header and footer in so they are always the
> same.
> > > >>
> > > >>  I do this now with SSI. In SSI I'll use the following statement:
> > > >>
> > > >>  
> > > >>
> > > >>  I like this cause it lets me use the same statement all over the
> site
> > > >>  and I don't have to worry about where the document is and how many
> > > >>  directories i have to go up an into "../../../../../"
> > > >>
> > > >>  I was guessing PHP's version would be:
> > > >>
> > > >>   > > >>  include("/includes/metatags.include");
> > > >>  ?>
> > > >>
> > > >>  However I get an error. If I put the absolute it works:
> > > >>
> > > >>   > > >>  include("/home/httpd/includes/metatags.include");
> > > >>  ?>
> > > >>
> > > >>  which is scary cause this worked too:
> > > >>
> > > >>   > > >>  include("/usr/local/apache/conf/httpd.conf");
> > > >>  ?>
> > > >>
> > > >>  doesn&#

Re: [PHP] include files

2001-02-05 Thread Steve Werby

"David VanHorn" <[EMAIL PROTECTED]> wrote:
> I know this works, in footer.inc, to pull up nomenu.
> 
>
> However, is there a more "generic" way to specify the server root as the
path?
> I'd rather not expose my directory structure in the PHP code.

How about the environment variable $DOCUMENT_ROOT (you may need to access as
$GLOBALS[DOCUMENT_ROOT] depending on your code).  Put  in
a webpage to see all of the goodies available to you.  I personally prefer
to keep the bulk of my PHP code outside the document root, in a directory
parallel to it.  I define a constant INC_PATH typically parallel to the
document root using code similar to the following:

// Set INC_PATH.
ereg( "(.*)web_directory.*", $SCRIPT_FILENAME, $regs );
define( "INC_PATH", $regs[1] . "inc_directory/" );

Then I include files as follows:

include( INC_PATH . "inc_common.php" );

Very portable.

> I tried various versions of ../ and ../../ without success.

This isn't very portable anyway.  You don't want to have to change paths if
you move a file to a deeper subdirectory.

--
Steve Werby
COO
24-7 Computer Services, LLC
Tel: 804.817.2470
http://www.247computing.com/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] include files

2001-02-05 Thread Brian V Bonini

DOCUMENT_ROOT  ???
http://php.net/manual/en/language.variables.predefined.php


> -Original Message-
> From: David VanHorn [mailto:[EMAIL PROTECTED]]
> Sent: Monday, February 05, 2001 12:16 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] include files
>
>
> I've got kind of a deep page structure, lots of subdirs.
> I'm having trouble with an include directive.
> The problem is a footer that I use on all pages, which resides in the base
> directory.
>
> The footer file includes another file, which I use if there is no menu.
> footer.inc has menu, and includes footer-nomenu.inc
> footer-nomenu.inc may be used alone.
>
> I know this works, in footer.inc, to pull up nomenu.
> 
>
> However, is there a more "generic" way to specify the server root
> as the path?
> I'd rather not expose my directory structure in the PHP code.
> I tried various versions of ../ and ../../ without success.
> --
> Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] include files

2001-02-05 Thread David VanHorn

At 12:50 PM 2/5/01 -0500, Brian V Bonini wrote:
>DOCUMENT_ROOT  ???
>http://php.net/manual/en/language.variables.predefined.php

Ok, but having read the docs you pointed to (thanks), I still don't see how 
to use it in an include directive.

I assume that since the vhost is specified to use "/home/dvh/public_html/" 
as the server root, that DOCUMENT_ROOT is equal to "/home/dvh/public_html/" 
when the server is  running any script from that vhost.

But, how do I apply that to the include directive?



--
Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] include files

2001-02-05 Thread Brian V Bonini



> -Original Message-
> From: David VanHorn [mailto:[EMAIL PROTECTED]]
> Sent: Monday, February 05, 2001 1:04 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: RE: [PHP] include files
> 
> 
> At 12:50 PM 2/5/01 -0500, Brian V Bonini wrote:
> >DOCUMENT_ROOT  ???
> >http://php.net/manual/en/language.variables.predefined.php
> 
> Ok, but having read the docs you pointed to (thanks), I still 
> don't see how 
> to use it in an include directive.
> 
> I assume that since the vhost is specified to use 
> "/home/dvh/public_html/" 
> as the server root, that DOCUMENT_ROOT is equal to 
> "/home/dvh/public_html/" 
> when the server is  running any script from that vhost.
> 
> But, how do I apply that to the include directive?
> 
> 
> 
> --
> Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9
> 
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] include files

2001-02-05 Thread Christian Reiniger

On Monday 05 February 2001 18:15, David VanHorn wrote:

> I know this works, in footer.inc, to pull up nomenu.
> 
>
> However, is there a more "generic" way to specify the server root as
> the path? I'd rather not expose my directory structure in the PHP code.
> I tried various versions of ../ and ../../ without success.

Set the include_patz in php.ini and include everything relative to that 
path

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

(A)bort (R)etry (P)retend this never happened ...

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] include() suggestion

2001-03-17 Thread Don Read


On 17-Mar-01 Steve Wardell wrote:
> I didn't know where else to post feature requests so I'll post it here.
> Could we get included files to not merely be sucked in to the file that is
> including it but still think of it as a distinctive file in terms of getting
> debug output for errors. The reasons for this are 2 fold:
> 
> 1) You could see all the files run by a particular page and not have to
> trace through files to see all the files which are called during a request
> to the server.
> 2) For error messages, it would give you the line number of the particular
> file that has the error and not the line number of the merged single file.
> 

Errm ...

Not sure what you mean by 'the line number of the merged single file.' ?
a syntax error will mention the correct file unless you don't close a
block.
For trace debuging i use (in common.php):

function debug($fl, $ln, $msg='') {
global $debug;
  
if (! empty($debug))
printf("%s %s:\n%s",
  $fl , $ln ,$msg);
}

and used as :
$qry="select id, name, contact, email, addr1, addr2, 
  city, state, 1zip, country, left(datesigned,10) as ds
  from webmaster where id=$qwid";

debug(__FILE__,__LINE__, $qry);

$res = mysql_query($qry);
if ( $res) {
 ...

just add &debug=1 to the url to trace out execution.

Regards,
-- 
Don Read [EMAIL PROTECTED]
-- If you are going to sin, sin against God, not the bureaucracy. 
  God will forgive you but the bureaucrats won't. 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] include() suggestion

2001-03-17 Thread Steve Wardell

Say you have index.php and 20 lines into index.php you include file.inc and
there's an error on line 30 of file.inc, but I'm pretty sure PHP would say
there was an error on line 50 of index.php and not like 30 of file.inc. It
doesn't keep track of included files as separate files that are called but
rather sort of merges it in memory into one file to run it seems.

Steve

"Don Read" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> On 17-Mar-01 Steve Wardell wrote:
> > I didn't know where else to post feature requests so I'll post it here.
> > Could we get included files to not merely be sucked in to the file that
is
> > including it but still think of it as a distinctive file in terms of
getting
> > debug output for errors. The reasons for this are 2 fold:
> >
> > 1) You could see all the files run by a particular page and not have to
> > trace through files to see all the files which are called during a
request
> > to the server.
> > 2) For error messages, it would give you the line number of the
particular
> > file that has the error and not the line number of the merged single
file.
> >
>
> Errm ...
>
> Not sure what you mean by 'the line number of the merged single file.' ?
> a syntax error will mention the correct file unless you don't close a
> block.
> For trace debuging i use (in common.php):
>
> function debug($fl, $ln, $msg='') {
> global $debug;
>
> if (! empty($debug))
> printf("%s
%s:\n%s",
>   $fl , $ln ,$msg);
> }
>
> and used as :
> $qry="select id, name, contact, email, addr1, addr2,
>   city, state, 1zip, country, left(datesigned,10) as ds
>   from webmaster where id=$qwid";
>
> debug(__FILE__,__LINE__, $qry);
>
> $res = mysql_query($qry);
> if ( $res) {
>  ...
>
> just add &debug=1 to the url to trace out execution.
>
> Regards,
> --
> Don Read [EMAIL PROTECTED]
> -- If you are going to sin, sin against God, not the bureaucracy.
>   God will forgive you but the bureaucrats won't.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] include() suggestion

2001-03-17 Thread Don Read


On 18-Mar-01 Steve Wardell wrote:
> Say you have index.php and 20 lines into index.php you include file.inc and
> there's an error on line 30 of file.inc, but I'm pretty sure PHP would say
> there was an error on line 50 of index.php and not like 30 of file.inc. It
> doesn't keep track of included files as separate files that are called but
> rather sort of merges it in memory into one file to run it seems.
> 

just tried it,

hitstats.php
--

require('secure.php');
authuser("Statistics");
include('history.php');
include('fpstats.php');


if (isset($lint))
error_reporting(31);
...

fpstats.php
---
removed a semi-colon.

browser output
---

Parse error:  parse error in fpstats.php on line 130
--
PHP/3.0.18 (maybe a 4.0 thing ?)


Regards,
-- 
Don Read [EMAIL PROTECTED]
-- If you are going to sin, sin against God, not the bureaucracy. 
  God will forgive you but the bureaucrats won't. 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Include files????

2001-04-02 Thread Felix Kronlage

On Mon, Apr 02, 2001 at 08:55:26AM -0300, Bruno Freire wrote:

> Anybody can tell me how can i do Include files?

has the thought of looking up the manual at php.net crossed your mind?
try searching php.net for include(), require()

-fkr
-- 
gpg-fingerprint: 076E 1E87 3E05 1C7F B1A0  8A48 0D31 9BD3 D9AC 74D0 
  |http://www.hazardous.org/ | whois -h whois.ripe.de FKR-RIPE  |
  |all your base are belong to us  |  shame on me  | fkr@IRCnet | 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Include Files

2001-04-04 Thread bizzk








...your HTML page...








I got this from www.devshed.com
(http://www.devshed.com/Server_Side/PHP/PHP101_1/page5.html). Check it out!

See You, Bizzk


""Mike"" <[EMAIL PROTECTED]> schreef in bericht
9afcj1$o9l$[EMAIL PROTECTED]">news:9afcj1$o9l$[EMAIL PROTECTED]...
> I'm trying to use html "include" syntax in a php page.If I use .shtml the
> php gets ignored .If I use php the  the
> php gets ignored.Is there a way of doing this without using the php
include
> function?
> Thanks
>
> Mike P
> [EMAIL PROTECTED]
>
>
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Include Files

2001-04-04 Thread Boget, Chris

> I'm trying to use html "include" syntax in a php page.If I 
> use .shtml the php gets ignored .If I use php the  the php gets ignored.Is there a way 
> of doing this without using the php include function?

Set up the .shtml extension so that it is parsed as PHP.

Chris



Re: [PHP] Include Files

2001-04-04 Thread Christian Reiniger

On Wednesday 04 April 2001 17:08, you wrote:
> I'm trying to use html "include" syntax in a php page.If I use .shtml
> the php gets ignored .If I use php the  the php gets ignored.Is there a way of doing this without using the
> php include function?
> Thanks

Stop resubmitting this every few minutes!

>
> Mike P
> [EMAIL PROTECTED]

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

"Software is like sex: the best is for free" -- Linus Torvalds

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Include files

2001-04-04 Thread CC Zona

In article <9afah8$8d3$[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] ("Mike") wrote:

> I'm trying to use html "include" syntax in a php page.If I use .shtml the
> php gets ignored .If I use php the  the
> php gets ignored.Is there a way of doing this without using the php include
> function?

http://www.php.net/virtual/

-- 
CC

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Include / Require

2001-04-05 Thread Lindsay Adams

On 4/5/01 10:56 AM, "Ashley M. Kirchner" <[EMAIL PROTECTED]> wrote:

> 
>   I have a DB project going and every time I query the DB for data
> from a particular table, I want to include a set of variables (that get
> set based on the query result).  I was thinking of doing something like
> this:
> 
>   $sql = "..."
>   $result = ;
>   include 'variables.php?table=$table';
> 
>   However, every time I try that, it tells me it can't find
> 'variables.php'.  However, if I rename the file to 'variables.inc', it
> does find it (though it doesn't pass any arguments to it then).
> 
>   The first method tells me it's not in the include path.  Okay,
> easily fixable in php.ini, however, I don't want this extra path info to
> apply to the whole server (which is running several vhosts).  How can I
> adjust the include path just for this particular vhost?
> 
>   Or, is there a better way to do what I'm trying to accomplish?  Make
> it a function perhaps?  A call that would look kinda like this perhaps:
> variables($table) ?  But then, how do I get to the actual variables?
> 
>   AMK4
> 

Ashley,

You don't really need to pass the values in your include.
All that include does is insert the file inine, as if it was written there.

So, leaving out the table=$table will still result in $table being defined
by the code prior to the include.

Ie.
$table="value or array or whatever"

Include("file that references $table.php");

// $table is still  in the global namespace, and the include file can
reference it as normal.

The only way you would need to pass values to the php file, like you did, is
if you were retrieving data from it through
fopen("http://domain.com/variables.php?table=$table",'r');

Include does not pre parse your file.

Hope that helps.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Include / Require

2001-04-05 Thread Johnson, Kirk

In addition to Lindsay's comments: 

Any time PHP can't include() a file, but it can include() it if you change
the filename, check the permissions on the original file. They may be set
too restrictive for PHP to read it.

Kirk

> -Original Message-
> From: Ashley M. Kirchner [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 05, 2001 11:57 AM
> To: PHP-General List
> Subject: [PHP] Include / Require
> 
> However, every time I try that, it tells me it can't find
> 'variables.php'.  However, if I rename the file to 'variables.inc', it
> does find it (though it doesn't pass any arguments to it then).

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Include / Require

2001-04-05 Thread Ashley M. Kirchner

Lindsay Adams wrote:

> So, leaving out the table=$table will still result in $table being defined
> by the code prior to the include.

Actually, the the I'm trying to include has several segments in it, which
depend on which table was just queries.  It basically looks like this:

if (table_1) {
return this set of variables
} elseif (table_2) {
return this other set
} elseif (table_3) {
return these ones
} else {
echo "you bonehead, you didn't include a table!";
}

You're saying, if I just include 'variables.inc', it will know what $table
is (from the main script) and would run through that routine fine?  Actually, it
makes sense, all it does is include it as if I wrote it in the main script.
Okay, so how can I make it so I only get the variables returned, as opposed to
it including the whole bit in the main script?  (kinda like the way a function()
with a return $var in it would work.)

AMK4

--
W |
  |  I haven't lost my mind; it's backed up on tape somewhere.
  |
  ~
  Ashley M. Kirchner    .   303.442.6410 x130
  SysAdmin / Websmith   . 800.441.3873 x130
  Photo Craft Laboratories, Inc. .eFax 248.671.0909
  http://www.pcraft.com  . 3550 Arapahoe Ave #6
  .. .  .  . .   Boulder, CO 80303, USA



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Include / Require

2001-04-05 Thread Chris Lee

is the file localhost? because the file being localhost or remote makes a huge 
difference. lets assume its localhost

incdex.php


now, variables.php will NOT return variables, thats not what is for. it just includes 
the code, thats it.

variables.php


there you. include does NOT return variables. imagine it like this, imagine you opened 
variables.php in your editor, and cut and paste all that code right exactly where 
include_once(...) was, thats what php is doing.

now

include_once("http://somedomain.com/variables.php");

is very very different, this will send and HTTP request for the page, local variables 
will not be seen by variables.php any variables set in variables.php will not be 
returened either.

include_once("http://somedomain.com/variables.php?table=test");

this will send the variable table to variables.php but variables.php will still not be 
able to return anything. using include_once(..) this way has limited usfullness. not 
saying its not usfull, just saying its limited.


-- 

 Chris Lee
 [EMAIL PROTECTED]





""Ashley M. Kirchner"" <[EMAIL PROTECTED]> wrote in message 
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Lindsay Adams wrote:

> So, leaving out the table=$table will still result in $table being defined
> by the code prior to the include.

Actually, the the I'm trying to include has several segments in it, which
depend on which table was just queries.  It basically looks like this:

if (table_1) {
return this set of variables
} elseif (table_2) {
return this other set
} elseif (table_3) {
return these ones
} else {
echo "you bonehead, you didn't include a table!";
}

You're saying, if I just include 'variables.inc', it will know what $table
is (from the main script) and would run through that routine fine?  Actually, it
makes sense, all it does is include it as if I wrote it in the main script.
Okay, so how can I make it so I only get the variables returned, as opposed to
it including the whole bit in the main script?  (kinda like the way a function()
with a return $var in it would work.)

AMK4

--
W |
  |  I haven't lost my mind; it's backed up on tape somewhere.
  |
  ~
  Ashley M. Kirchner    .   303.442.6410 x130
  SysAdmin / Websmith   . 800.441.3873 x130
  Photo Craft Laboratories, Inc. .eFax 248.671.0909
  http://www.pcraft.com  . 3550 Arapahoe Ave #6
  .. .  .  . .   Boulder, CO 80303, USA



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Include / Require

2001-04-05 Thread Plutarck

This is a good time for a quick lesson on just exactly what include/require
actually does.

The following two examples are exactly the same, in almost every way:

=== Example 1 ===

example1A.php:



example1B.php:



The output is "Hello World!", and that's all.

=== Example 2 ===

example2.php:



The output is "Hello World!"

When you include a file it is almost exactly the same as if you went into
the included file, cut out all the code, then went back into your first file
and pasted it in.

So what you can use an included file almost exactly as you would use a
function, without declaring anything as global! But there are obvious
reasons why functions are better than includes, but you probably know that
;)

Example:

first file:



include.php:



Now you could do the exact same thing by just making the include file into a
function. Or you could just paste it into your original file.

But the output remainds the same, no matter how you slice it.


QUESTION ANSWER:

The following:

> $sql = "..."
> $result = ;
> include 'variables.php?table=$table';

Can be like this:

$table = "tablename";
$sql = "...";
$result = "...";
include ("variables.php");

The values of $table, $sql, and $result will all be the same in
variables.php as they are in your source file.

Isn't that nice? Aren't you glad that I took 4 pages of text just to explain
that single phrase? Shouldn't I get a pulitser for taking so little content
and putting it into so much display? I should work for microsoft, shouldn't
I?


--
Plutarck
Should be working on something...
...but forgot what it was.



""Ashley M. Kirchner"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> I have a DB project going and every time I query the DB for data
> from a particular table, I want to include a set of variables (that get
> set based on the query result).  I was thinking of doing something like
> this:
>
> $sql = "..."
> $result = ;
> include 'variables.php?table=$table';
>
> However, every time I try that, it tells me it can't find
> 'variables.php'.  However, if I rename the file to 'variables.inc', it
> does find it (though it doesn't pass any arguments to it then).
>
> The first method tells me it's not in the include path.  Okay,
> easily fixable in php.ini, however, I don't want this extra path info to
> apply to the whole server (which is running several vhosts).  How can I
> adjust the include path just for this particular vhost?
>
> Or, is there a better way to do what I'm trying to accomplish?  Make
> it a function perhaps?  A call that would look kinda like this perhaps:
> variables($table) ?  But then, how do I get to the actual variables?
>
> AMK4
>
> --
> W |
>   |  I haven't lost my mind; it's backed up on tape somewhere.
>   |
>   ~
>   Ashley M. Kirchner    .   303.442.6410 x130
>   SysAdmin / Websmith   . 800.441.3873 x130
>   Photo Craft Laboratories, Inc. .eFax 248.671.0909
>   http://www.pcraft.com  . 3550 Arapahoe Ave #6
>   .. .  .  . .   Boulder, CO 80303, USA
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] include("../file.inc");

2001-05-11 Thread Taylor, Stewart

Either of the first two should work under linux.

I have done similar many times myself
e.g.
require_once "../common/localvars.php";


-Stewart

-Original Message-
From: Matthew Ralston [mailto:[EMAIL PROTECTED]]
Sent: 11 May 2001 11:40
To: [EMAIL PROTECTED]
Subject: [PHP] include("../file.inc");


How do you include or require a file that is above the current script in the
directory hierarchy? For example how would I include or require a file whose
path is "../file.inc" relative to the current script? I tried all of:

include("../file.inc");
require("../file.inc");
include("/file.inc");
require("/file.inc");
include("..\file.inc");
require("..\file.inc");
include("\file.inc");
require("\file.inc");

but it doen't like any of them. :(
I don't want to use a full path relative to the root of the drive or
webserver folder because the included file and the script may move as the
development server is setup differently to the real web server.

Any ideas?

--
Thanks,

Matt
[EMAIL PROTECTED]
< www.mralston.co.uk />




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] include("../file.inc");

2001-05-11 Thread Jakob Kruse

You may need to set your include_path to "." in php.ini. Than again maybe
not. Try it. Then include "../file.inc" should work (on Unix or Linux, use
"\" on Windows).

Regards,
Jakob Kruse

""Matthew Ralston"" <[EMAIL PROTECTED]> wrote in message
9dgfbo$kom$[EMAIL PROTECTED]">news:9dgfbo$kom$[EMAIL PROTECTED]...
> How do you include or require a file that is above the current script in
the
> directory hierarchy? For example how would I include or require a file
whose
> path is "../file.inc" relative to the current script? I tried all of:
>
> include("../file.inc");
> require("../file.inc");
> include("/file.inc");
> require("/file.inc");
> include("..\file.inc");
> require("..\file.inc");
> include("\file.inc");
> require("\file.inc");
>
> but it doen't like any of them. :(
> I don't want to use a full path relative to the root of the drive or
> webserver folder because the included file and the script may move as the
> development server is setup differently to the real web server.
>
> Any ideas?
>
> --
> Thanks,
>
> Matt
> [EMAIL PROTECTED]
> < www.mralston.co.uk />
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] include("../file.inc");

2001-05-14 Thread kelvin chan .


Hi,

I came across this problem before, when I was working with windows. Not sure 
if the same problem occurs in Linux, i guess not as otherwise there would 
have been tonnes of postings on that then.

Well, basically my script architecture spans over at least 3 directory 
levels. Just for the sake of discussion let my highest directory be A. 
followed by B, and then C.

My A script is the module controller. the B script is the module, and it 
imports all of its functions by importing scripts contained in C.

So my A script has the line : include("B/fileB.php");
My B "fileB.php" script has : include("C/fileC.php");

Theorectically this is sufficient for A to manage my C scripts. However, i 
realised that PHP wasn't able to do that. The reason being that when A 
script is runned, the contents of fileB.php are sort of "pasted" onto the A 
script. Now the A script sort of has a

include("C/fileC.php");

line of code. this will generate an error, as there is no C directory 
relative to the A directory.


1. you may have generated errors if you have, like me, been working with 
multiple directories, and not taken notice of that subtle problem above. The 
work-around is to put

include("B/C/fileC.php");

in the B script.

2. in your case "require" or "include" makes no difference, but there is a 
subtle difference when used in other situations, you might wanna check that 
out when you are free.

3. My example above is slightly different from yours as yours is traversing 
up a tree, mine was traversing down the tree. However, the conclusion still 
stands: take note and display full paths when working with directory levels 
exceeding 2.


If theres anything you'll like to ask about what i said here, or otherwise, 
pl mail me directly, as i dun check this list very often. All the best then! 
=)

kelvin Chan




Message-ID: <[EMAIL PROTECTED]>
From: "Taylor, Stewart" <[EMAIL PROTECTED]>
To: "'Matthew Ralston'" <[EMAIL PROTECTED]>,
   [EMAIL PROTECTED]
Date: Fri, 11 May 2001 11:52:17 +0100
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Subject: RE: [PHP] include("../file.inc");

Either of the first two should work under linux.

I have done similar many times myself
e.g.
require_once "../common/localvars.php";


-Stewart

-Original Message-
From: Matthew Ralston [mailto:[EMAIL PROTECTED]]
Sent: 11 May 2001 11:40
To: [EMAIL PROTECTED]
Subject: [PHP] include("../file.inc");


How do you include or require a file that is above the current script in the
directory hierarchy? For example how would I include or require a file whose
path is "../file.inc" relative to the current script? I tried all of:

include("../file.inc");
require("../file.inc");
include("/file.inc");
require("/file.inc");
include("..\file.inc");
require("..\file.inc");
include("\file.inc");
require("\file.inc");

but it doen't like any of them. :(
I don't want to use a full path relative to the root of the drive or
webserver folder because the included file and the script may move as the
development server is setup differently to the real web server.

Any ideas?

--
Thanks,

Matt
[EMAIL PROTECTED]
< www.mralston.co.uk />




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] include + path

2001-05-17 Thread elias

Easy, ...
Use JavaScript
or simple HTML...

javascript:



Now you've just been called from another server!
Now from within your script you can get lots of informations like:
$HTTP_REFERER ...


-elias
http://www.eassoft.cjb.net


""Greg Wright"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello All,
>
> I have a app that is used to track stats, it was designed to be used on
the
> smae server that the website being tracked is, it uses an include and a
> path statement to register a hit in the page being displayed.
>
> Does anyone know of a method where I could get the remote website to
invoke
> the stat counter? ie is there something that can be used on the remote
site
> to call a php file on another server, this other file would be on the same
> server as the stats php app and therefore include the "include" function
> and the path, the main problem or hold up as I see it is the need for a
> path and not being able to use a http:// path, if the above is not clear I
> will e-mail off list if reqd.
>
> an example is..
>
> each page being tracked needs something like this locally
>
> $file_include_dir = "/stats/include/';
> include($file_include_dir.'stats/include/visitor.inc.php3');
>
> how could this be invoked remotely, or how else does anyone see this as
> being able to be done, in the remote page I want the effect to be
> transparent
>
> Thanks...
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Include Paths

2001-05-20 Thread Christian Reiniger

On Saturday 19 May 2001 23:18, Dylan Finney wrote:

> I am fairly new to PHP and so far I love it.  One question I have is
> how to call include files outside of their directory without hard
> coding the real path to the file itself.  Is there map path or a

See the include_path ini directive in the config section of the manual

> similar function in PHP? Also when i use readfile() or fpassthru() when
> I echo the result what I assume is the file size is added to the end of
> the line.  i.e.( blah blah blah will produce a 14 at the end of the
> line ) I was curious as to if there is a flag i'm missing that is
> causing them to do that.  Thank you for the help!

You do a
print (readfile ('foo'));
right?

Well, readfile reads the file *and outputs it*, then returns the number 
of chars read. That is passed to print (). So just use
readfile ('foo');

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

I saw God - and she was black.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Include & Speed

2001-06-20 Thread scott [gts]

include() is not magical.  it's all PHP code,
whether or not you put it into your "main" file,
or pull it in with an include()

if it's slow - it's slow, regardless of *how*
it was brought into the script.

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 20, 2001 4:11 AM
> To: php-general
> Subject: [PHP] Include & Speed
> 
> 
> Hi everybody,
> 
> How much the include() can slow down the execution of the scripts; if I
> call one file let say for the db connection it's clearly ok but is it a
> limite of numbers of include in one script from where that slow the
> process?
> 
> Marc
> -- 
> 
> 
>   /*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*
>   /* Marc Fourny  /*
>   /*  Multimedia Development for the web  /*
>   /*  &   /*
>   /*CD-ROM/*
>   /*   Fourny ElectronicEDiting   /*
>   /*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Include & Speed

2001-06-20 Thread tony . mccrory


Isn't it fair to say that having the server open the extra file will add to
the total execution time of the page?




   

"scott [gts]"  

 

ctype.com>   cc:   

     Subject: RE: [PHP] Include & Speed

06/20/2001 

04:33 PM   

   

   





include() is not magical.  it's all PHP code,
whether or not you put it into your "main" file,
or pull it in with an include()

if it's slow - it's slow, regardless of *how*
it was brought into the script.

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 20, 2001 4:11 AM
> To: php-general
> Subject: [PHP] Include & Speed
>
>
> Hi everybody,
>
> How much the include() can slow down the execution of the scripts; if I
> call one file let say for the db connection it's clearly ok but is it a
> limite of numbers of include in one script from where that slow the
> process?
>
> Marc
> --
>
>
>/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*
>/*   Marc Fourny/*
>/*   Multimedia Development for the web   /*
>/* &  /*
>/*  CD-ROM  /*
>/*Fourny ElectronicEDiting   /*
>/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



IMPORTANT NOTICE  The information in this e-mail is confidential and should
only be read by those persons to whom it is addressed and is not intended
to be relied upon by any person without subsequent written confirmation of
its contents.  Furthermore, the content of this e-mail is the personal view
of the sender and does not represent the advice, views or opinion of our
company.  Accordingly, our company disclaim all responsibility and accept
no liability (including in negligence) for the consequences of any person
acting, or refraining from acting, on such information prior to the receipt
by those persons of subsequent written confirmation.  In particular (but
not by way of limitation) our company disclaims all responsibility and
accepts no liability for any e-mails which are defamatory, offensive,
racist or in any other way are in breach of any third party's rights,
including breach of confidence, privacy or other rights.  If you have
received this e-mail message in error, please notify me immediately by
telephone.  Please also destroy and delete the message from your computer.
Any form of reproduction, dissemination, copying, disclosure, modification,
distribution and/or publication of this e-mail message is strictly
prohibited.  Trinity Mirror plc is the holding company for the Trinity
Mirror group of companies and is registered in England No. 82548, with its
address at Kingsfield Court, Chester Business Park, Chester CH4 9RE.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Include & Speed

2001-06-20 Thread Jason Murray

> Isn't it fair to say that having the server open the extra 
> file will add to the total execution time of the page?

I think if it significantly impacts the execution time, you have bigger
problems with your server. :)

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] include question

2001-09-17 Thread Scott

At 02:03 AM 9/18/2001 +0200, Chris Hayes wrote:
>  2) let them make a real template, either a file or a database
>cell, for instance
> fhkhfsahehfaa[DATA1]
>and do a str replace [DATA1] parts --> database content.

Chris-

YOU ROCK!  Thank you for the thought starter, I have been beating my head
on this most of the day.  I have to confess that this site was done in ASP and
I have been moving parts over to PHP and was not thinking clearly.  I was
thinking I was still under the ASP limitations :)

Anyway, here is the code I am using.  I will keep the templates in the db
and call them, but I put a [BODY DATA] block in the template file, and then
do a string replace as such:

$temp = str_replace("[BODY DATA]", $body,$template);

echo $temp;

Can anyone tell me the limit or format to do multiple replaces, example:
I have 5 fields that I need to replace, do I create a variable for each 
replacement?
$temp = str_replace("[BODY DATA]", $body,$template);
$temp2 = str_replace("[TOP_GRAPHIC]",$top_graphic, $temp);
and so on -OR- can I do it in one statement?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] include() problem...

2001-09-20 Thread Jeb Anderson Scarbrough

If you put the file into the include directory specified in the php.ini 
(.:/usr/lib/php) then I believe you should do:

include("mysql.php");

NOT

include("DB/mysql.php");

Someone please correct me if I'm wrong.




I've got a very odd problem. I'm trying to include 'DB/mysql.php', from
the /usr/lib/php directory, and it's not working. My include_path is set
properly (.:/usr/lib/php) and when I do
'print_r(ini_get("include_path"));' it prints it properly. But when I
try and do an include, I get the following error.

Warning: Failed opening 'DB/mysql.php' for inclusion (include_path='')
in /usr/local/httpd/htdocs/test.php on line 2

Help? Please? I'm at a loss as to how to fix this, and I kind of need
to.

--
Matthew Walker
Ecommerce Project Manager
Mountain Top Herbs

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.281 / Virus Database: 149 - Release Date: 9/18/2001

_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] include() problem...

2001-09-20 Thread Matthew Walker

I've tried including just a file that was in the /usr/lib/php directory.
No luck. I get exactly the same error (with the correct file name,
obviously). Also, note in the error that include() is seeing
include_path=''. What's up with that?

-Original Message-
From: Jeb Anderson Scarbrough [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, September 20, 2001 12:04 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] include() problem...

If you put the file into the include directory specified in the php.ini 
(.:/usr/lib/php) then I believe you should do:

include("mysql.php");

NOT

include("DB/mysql.php");

Someone please correct me if I'm wrong.




I've got a very odd problem. I'm trying to include 'DB/mysql.php', from
the /usr/lib/php directory, and it's not working. My include_path is set
properly (.:/usr/lib/php) and when I do
'print_r(ini_get("include_path"));' it prints it properly. But when I
try and do an include, I get the following error.

Warning: Failed opening 'DB/mysql.php' for inclusion (include_path='')
in /usr/local/httpd/htdocs/test.php on line 2

Help? Please? I'm at a loss as to how to fix this, and I kind of need
to.

--
Matthew Walker
Ecommerce Project Manager
Mountain Top Herbs

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.281 / Virus Database: 149 - Release Date: 9/18/2001

_
Get your FREE download of MSN Explorer at
http://explorer.msn.com/intl.asp


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.281 / Virus Database: 149 - Release Date: 9/18/2001

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.281 / Virus Database: 149 - Release Date: 9/18/2001



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] include() problem...

2001-09-20 Thread Johnson, Kirk

Check the permissions on both the directory and the file, so that they are
accessible to 'nobody' (or whomever PHP is running as). I'm not sure what to
make of the empty include path in the error message.

Kirk


> I've tried including just a file that was in the /usr/lib/php 
> directory.
> No luck. I get exactly the same error (with the correct file name,
> obviously). Also, note in the error that include() is seeing
> include_path=''. What's up with that?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] include() problem...

2001-09-20 Thread Matthew Walker

Checked that. Plenty of permissions.

Anyone else have any idea?

-Original Message-
From: Johnson, Kirk [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, September 20, 2001 1:48 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] include() problem...

Check the permissions on both the directory and the file, so that they
are
accessible to 'nobody' (or whomever PHP is running as). I'm not sure
what to
make of the empty include path in the error message.

Kirk


> I've tried including just a file that was in the /usr/lib/php 
> directory.
> No luck. I get exactly the same error (with the correct file name,
> obviously). Also, note in the error that include() is seeing
> include_path=''. What's up with that?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.281 / Virus Database: 149 - Release Date: 9/18/2001

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.281 / Virus Database: 149 - Release Date: 9/18/2001



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] include() problem...

2001-09-20 Thread Matthew Walker

Okay... This is odd. Despite the fact that
'print_r(ini_get("include_path"));' returns the right include_path, I
just checked the php.ini file, and lo and behold, there is no include
path set. So... Have I just discovered a bug?

-Original Message-
From: Matthew Walker [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, September 20, 2001 2:52 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] include() problem...

Checked that. Plenty of permissions.

Anyone else have any idea?

-Original Message-
From: Johnson, Kirk [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, September 20, 2001 1:48 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] include() problem...

Check the permissions on both the directory and the file, so that they
are
accessible to 'nobody' (or whomever PHP is running as). I'm not sure
what to
make of the empty include path in the error message.

Kirk


> I've tried including just a file that was in the /usr/lib/php 
> directory.
> No luck. I get exactly the same error (with the correct file name,
> obviously). Also, note in the error that include() is seeing
> include_path=''. What's up with that?


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.281 / Virus Database: 149 - Release Date: 9/18/2001



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] include() and URL's

2002-01-17 Thread Johnson, Kirk

Does the file have persmissions such that it is include()-able by nobody?

Kirk

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 16, 2002 4:33 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] include() and URL's
> 
> 
> I'm trying to include a URL using the following line
> 
> include('http://www.cci.net.au/default.htm');
> 
> I get the following response.
> 
> Warning: Failed opening 'http://www.cci.net.au/default.htm' for
> inclusion (include_path='') in C:\Inetpub\wwwroot\template\index.php
> on line 61
> 
> I have made sure the url_fopen_wrappers is enabled in the php.ini file
> but apart from this I'm kind of lost as to what is causing the
> problem. Any suggestions?
> 
> Hippie.
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: 
> [EMAIL PROTECTED]
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] include() and URL's

2002-01-17 Thread John (News)

The file is running on an NT box and can be accessed fine through IIS. It 
is only when using the include() statement to this file that problems 
occur. If I do a local path map to it, it will include fine but when using 
an URL it gives that error.

Hippie.

At 05:02 PM 1/17/02 -0700, you wrote:
>Does the file have persmissions such that it is include()-able by nobody?
>
>Kirk
>
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, January 16, 2002 4:33 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] include() and URL's
> >
> >
> > I'm trying to include a URL using the following line
> >
> > include('http://www.cci.net.au/default.htm');
> >
> > I get the following response.
> >
> > Warning: Failed opening 'http://www.cci.net.au/default.htm' for
> > inclusion (include_path='') in C:\Inetpub\wwwroot\template\index.php
> > on line 61
> >
> > I have made sure the url_fopen_wrappers is enabled in the php.ini file
> > but apart from this I'm kind of lost as to what is causing the
> > problem. Any suggestions?
> >
> > Hippie.
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail:
> > [EMAIL PROTECTED]
> >
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] include() and URL's

2002-01-17 Thread Jason Murray

> The file is running on an NT box and can be accessed fine 
> through IIS. It is only when using the include() statement to 
> this file that problems occur. If I do a local path map to it, 
> it will include fine but when using an URL it gives that error.

Can you retrieve the file from that URL from the command line
on that machine? (try 'wget' or 'curl', or even just 'lynx')

It's possible that while you can see it from your workstation,
the server PHP is installed on cannot.

Jason

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] include() and URL's

2002-01-17 Thread John (News)

I'm using my workstation as an all in one test box. It's running, IIS 4.0, 
and PHP for Windows version 4.0.6.

At 11:13 AM 1/18/02 +1100, you wrote:
> > The file is running on an NT box and can be accessed fine
> > through IIS. It is only when using the include() statement to
> > this file that problems occur. If I do a local path map to it,
> > it will include fine but when using an URL it gives that error.
>
>Can you retrieve the file from that URL from the command line
>on that machine? (try 'wget' or 'curl', or even just 'lynx')
>
>It's possible that while you can see it from your workstation,
>the server PHP is installed on cannot.
>
>Jason
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] include() and paths

2002-03-01 Thread DL Neil

Hi Nick,

> masterfile.inc lives in /var/www/includes/ and contains this line:
> include("/var/www/includes/anotherfile.inc");
>
> in index.php I include masterfile.inc and thus get anotherfile.inc.
>
> What I'd like to know though is, is it possible to have the include
line
> in masterfile.inc specify a url *relative* to itself?
> like:
> // masterfile.inc
> include("anotherfile.inc"); // now the path is relative.


AFAIK the options are absolute addressing, relative addressing (to the
php.ini), and http access.

RTFM the four pages from
http://www.php.net/manual/en/function.require.php. There's quite a bit
of advice/experience in the user annotations!

Regards,
=dn


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] include() and paths

2002-03-01 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then DL Neil declared
> > masterfile.inc lives in /var/www/includes/ and contains this line:
> > include("/var/www/includes/anotherfile.inc");
> >
> > in index.php I include masterfile.inc and thus get anotherfile.inc.
> >
> > What I'd like to know though is, is it possible to have the include
> line
> > in masterfile.inc specify a url *relative* to itself?
> > like:
> > // masterfile.inc
> > include("anotherfile.inc"); // now the path is relative.
> 
> 
> AFAIK the options are absolute addressing, relative addressing (to the
> php.ini), and http access.
> 
> RTFM the four pages from
> http://www.php.net/manual/en/function.require.php.; There's quite a bit
> of advice/experience in the user annotations!

Please don't RTFM me, that's the first place I went. I didn't find what
I'm looking for so I came here.
- -- 
- ---
 www.explodingnet.com   |Projects, Forums and
+Articles for website owners 
- -- Nick Wilson -- |and designers.

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE8f2/pHpvrrTa6L5oRAgH+AJ0bbArcqX1Um1muNIjV789qCEvv/gCfW9RA
jFT4TxiP5n4tUpgPl5NAG1I=
=/ZY3
-END PGP SIGNATURE-

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] include() and paths

2002-03-01 Thread Nick Winfield

On Fri, 1 Mar 2002, Nick Wilson wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
>
> * and then DL Neil declared
> > > masterfile.inc lives in /var/www/includes/ and contains this line:
> > > include("/var/www/includes/anotherfile.inc");
> > >
> > > in index.php I include masterfile.inc and thus get anotherfile.inc.
> > >
> > > What I'd like to know though is, is it possible to have the include
> > line
> > > in masterfile.inc specify a url *relative* to itself?
> > > like:
> > > // masterfile.inc
> > > include("anotherfile.inc"); // now the path is relative.
> >
> >
> > AFAIK the options are absolute addressing, relative addressing (to the
> > php.ini), and http access.
> >
> > RTFM the four pages from
> > http://www.php.net/manual/en/function.require.php.; There's quite a bit
> > of advice/experience in the user annotations!
>
> Please don't RTFM me, that's the first place I went. I didn't find what
> I'm looking for so I came here.

I didn't catch the first part of this thread (rampant deletion ahoy) so
please excuse if I am talking nadgers.  The way I see it, if you are
calling includes/requires from within other includes, the path is that of
the script that makes the first include.  If that makes any sense.

So if you have a file called includes.php in your /home/webroot that
includes/requires files in a subdir called /home/webroot/stuff/ and those
files include/require other files within that same directory (such as
/home/webroot/stuff/class.cheese.php), then the includes would look like
this:

# index.php
include("includes.php");
.
.
.
.

# includes.php
include("stuff/dbstuff.php");
.
.
.
.

# stuff/dbstuff.php
include ("stuff/class.cheese.php");
.
.
.
.

Am I making any sense? :-)

Regards,

Nick Winfield.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] include() and paths

2002-03-01 Thread DL Neil

and Nick Wilson opined in what could be seen to be an arrogant
fashion...
> * and then DL Neil declared
> > > masterfile.inc lives in /var/www/includes/ and contains this line:
> > > include("/var/www/includes/anotherfile.inc");
> > >
> > > in index.php I include masterfile.inc and thus get
anotherfile.inc.
> > >
> > > What I'd like to know though is, is it possible to have the
include
> > line
> > > in masterfile.inc specify a url *relative* to itself?
> > > like:
> > > // masterfile.inc
> > > include("anotherfile.inc"); // now the path is relative.
> >
> >
> > AFAIK the options are absolute addressing, relative addressing (to
the
> > php.ini), and http access.
> >
> > RTFM the four pages from
> > http://www.php.net/manual/en/function.require.php. There's quite a
bit
> > of advice/experience in the user annotations!
>
> Please don't RTFM me, that's the first place I went. I didn't find
what
> I'm looking for so I came here.

It's a two-way street: please tell us what you have done so that we
don't waste our time trying to help you with 'basic' suggestions when
you're looking for 'the next step up'. Particularly if your enquiry is
basically the hope that the (good quality/fine) manual doesn't mention
something - a most unlikely scenario.
=dn


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] include() and paths

2002-03-01 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then Nick Winfield declared
> I didn't catch the first part of this thread (rampant deletion ahoy) so
> please excuse if I am talking nadgers.  The way I see it, if you are
> calling includes/requires from within other includes, the path is that of
> the script that makes the first include.  If that makes any sense.

Sure does, just wondered if anyone could see a way round my little wish
:-) AFAIK there is no easy way to do this and as neither the manual nor
this list has been able to tell me different I'll have to find another
solution. Thanks for the help though!
- -- 
- ---
 www.explodingnet.com   |Projects, Forums and
+Articles for website owners 
- -- Nick Wilson -- |and designers.

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE8f7q1HpvrrTa6L5oRArMgAJ9ETCkt5vxJSVs7O9Ervfkl9wxc4gCdFG9q
Hp8nJGb56lec5ckoIbdb7WI=
=4FXP
-END PGP SIGNATURE-

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] include() and paths

2002-03-01 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then DL Neil declared
> > > RTFM the four pages from
> > > http://www.php.net/manual/en/function.require.php.; There's quite a
> bit
> > > of advice/experience in the user annotations!
> >
> > Please don't RTFM me, that's the first place I went. I didn't find
> what
> > I'm looking for so I came here.
> 
> It's a two-way street: please tell us what you have done so that we
> don't waste our time trying to help you with 'basic' suggestions when
> you're looking for 'the next step up'. Particularly if your enquiry is
> basically the hope that the (good quality/fine) manual doesn't mention
> something - a most unlikely scenario.

If you just want to rude and superior please do it elsewhere, this is a
busy list.

- -- 
- ---
 www.explodingnet.com   |Projects, Forums and
+Articles for website owners 
- -- Nick Wilson -- |and designers.

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE8f7r8HpvrrTa6L5oRAttAAKCWKkby/MBC5rVbJjUAhGahyOJkawCffA2o
c3G6zp9KuN2ie8A/y9rEpl4=
=cyUe
-END PGP SIGNATURE-

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] include() and paths

2002-03-05 Thread Ford, Mike [LSS]

> -Original Message-
> From: Nick Wilson [mailto:[EMAIL PROTECTED]]
> Sent: 01 March 2002 17:30
> To: PHP-General
> Subject: Re: [PHP] include() and paths
> 
> 
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> 
> * and then Nick Winfield declared
> > I didn't catch the first part of this thread (rampant 
> deletion ahoy) so
> > please excuse if I am talking nadgers.  The way I see it, if you are
> > calling includes/requires from within other includes, the 
> path is that of
> > the script that makes the first include.  If that makes any sense.
> 
> Sure does, just wondered if anyone could see a way round my 
> little wish
> :-) AFAIK there is no easy way to do this and as neither the 
> manual nor
> this list has been able to tell me different I'll have to find another
> solution. Thanks for the help though!

H'mm, the only even *vaguely* useful thing I can think of here is that 
dirname(__FILE__) should give you the full directory path of the *current* include 
file.  Fine for "here-relative" names, but you'd need to manipulate it further to do 
the equivalent of ..-type relativities.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] include() and paths

2002-03-06 Thread Patrick Teague

ok, so this makes alot of since...  if I move my website from one server to
another server I'll have to go through every single file & redo the
directory structure?  Isn't this the reason for the includes...  so you
don't have to go through every single file to make changes?  Maybe I should
go back to ASP...

#include virtual="/includes/myinclude.inc"

or is there a way to get this to work via php on apache?

Patrick



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] include() and paths

2002-03-06 Thread michael kimsal

Patrick Teague wrote:
> ok, so this makes alot of since...  if I move my website from one server to
> another server I'll have to go through every single file & redo the
> directory structure?  Isn't this the reason for the includes...  so you
> don't have to go through every single file to make changes?  Maybe I should
> go back to ASP...
> 
> #include virtual="/includes/myinclude.inc"
> 
> or is there a way to get this to work via php on apache?

Per http://www.php.net/manual/en/function.ini-set.php, PHP_INCLUDE_PATH 
is an 'ini' setting which you can change - you could either set it in 
your php.ini once, and point it to one common 'includes' direcotry.  Or 
possibly set it per apache virtual server (via .htaccess perhaps in a
main root directory).

Another thought is to simply make all your include statements use a
constant, such as DOCUMENT_ROOT or something else (we use something
else but the idea is the same).  Yes, all includes need to be written as

include(MYDIRPATH."/relative/stuff.php");

Also, try

ini_set(PHP_INCLUDE_PATH,DOCUMENT_ROOT);

at the top of your page(s).  That might do the trick.

but it makes everything a heck of a lot more portable.  Don't go back to 
ASP.  If you really want to use  stuff Apache
supports that via .shtml files.  There are probably ways of getting the
two to work together (PHP and SSI) though I'm not sure why you'd want to 
do so.  :)  Remember ASP is a framework, and VBScript is the popular 
language there.  VBScript doesn't support includes at all - it's ASP 
calling an SSI interpreter, include()ing things, then passing to the 
language.  PHP is just a language.   There are some pretty ugly, 
inelegant things going on under the hood with respect to includes under 
ASP - if you want gorey details let me know.  :)

After writing all this I see it's basically a rehash of the 9/2/2001 
posting in the user comments under include at the php manual site.  Is 
there a reason one of those 3 options isn't viable?

Michael Kimsal
http://www.phphelpdesk.com
Taking the ? out of http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] include through HTTP

2002-04-12 Thread Collins, Robert

Check the Note about 5 lines down on this page.
http://www.php.net/manual/en/features.remote-files.php

"Note: You can't use remote files in include() and require() statements on
Windows."

Robert W. Collins II 
Webmaster 
New Orleans Regional Transit Authority 
Phone : (504) 248-3826 
Email : [EMAIL PROTECTED] 



-Original Message-
From: Barýþ" Mert [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 12, 2002 8:13 AM
To: [EMAIL PROTECTED]
Subject: [PHP] include through HTTP


What i want to do is :
include("http://localhost/folder/file.php?foo=bar";);
but it doesn't work. As you may guess it looks for a
file called "file.php?foo=bar". "url_fopen" is set to
"on" in my php.ini file as told in the PHP manual.
I work on win98+apache+php4.1.1(or something like that
but at least 4.1...)
Do you know what's the problem?
Info about this subject is on 
http://www.php.net/manual/en/function.include.php
...

__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] include through HTTP

2002-04-12 Thread Barýþ

Oh what a shame on me! Sorry and thank you...

--- "Collins, Robert" <[EMAIL PROTECTED]> wrote:
> Check the Note about 5 lines down on this page.
>
http://www.php.net/manual/en/features.remote-files.php
> 
> "Note: You can't use remote files in include() and
> require() statements on
> Windows."
> 
> Robert W. Collins II 
> Webmaster 
> New Orleans Regional Transit Authority 
> Phone : (504) 248-3826 
> Email : [EMAIL PROTECTED] 
> 
> 
> 
> -Original Message-
> From: Barýþ" Mert [mailto:[EMAIL PROTECTED]]
> Sent: Friday, April 12, 2002 8:13 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] include through HTTP
> 
> 
> What i want to do is :
> include("http://localhost/folder/file.php?foo=bar";);
> but it doesn't work. As you may guess it looks for a
> file called "file.php?foo=bar". "url_fopen" is set
> to
> "on" in my php.ini file as told in the PHP manual.
> I work on win98+apache+php4.1.1(or something like
> that
> but at least 4.1...)
> Do you know what's the problem?
> Info about this subject is on 
> http://www.php.net/manual/en/function.include.php
> ...
> 
> __
> Do You Yahoo!?
> Yahoo! Tax Center - online filing with TurboTax
> http://taxes.yahoo.com/
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] include through HTTP

2002-04-12 Thread Rasmus Lerdorf

Why do you want to include from localhost over HTTP?  Sounds to me like
you want to do:

$foo='bar';
include "$DOCUMENT_ROOT/folder/file.php";

-Rasmus

On Fri, 12 Apr 2002, Barýþ Mert wrote:

> What i want to do is :
> include("http://localhost/folder/file.php?foo=bar";);
> but it doesn't work. As you may guess it looks for a
> file called "file.php?foo=bar". "url_fopen" is set to
> "on" in my php.ini file as told in the PHP manual.
> I work on win98+apache+php4.1.1(or something like that
> but at least 4.1...)
> Do you know what's the problem?
> Info about this subject is on
> http://www.php.net/manual/en/function.include.php
> ...
>
> __
> Do You Yahoo!?
> Yahoo! Tax Center - online filing with TurboTax
> http://taxes.yahoo.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] include through HTTP

2002-04-13 Thread Barýþ


file.php does more than one jobs depending on
HTTP_GET_VARS. for example if "..?mod=show" or it is
empty it shows things, elseif "..?mod=update" it
updates... so i must send a variable to the included
file but i can't do it in the file that includes it.
The file that includes file.php is a template file
which holds the design of the site and each page is
included in to that template. 
My English is not very good so if you can't see a
reason not to do it your way i will try to write a
more clear explanation.
Thank you!
Oh! that's an important point:
on index.php(the template file) it decides which file
to include with a switch.
//querystring: /index.php?page=a_page
switch $page
case "a_page":
  $inc = "http://$myhost/a_page.php";;
case "another_page":
  $inc =
"http://$myhost/a_page.php?mod=something";;

include($inc);





--- Rasmus Lerdorf <[EMAIL PROTECTED]> wrote:
> Why do you want to include from localhost over HTTP?
>  Sounds to me like
> you want to do:
> 
> $foo='bar';
> include "$DOCUMENT_ROOT/folder/file.php";
> 
> -Rasmus
> 
> On Fri, 12 Apr 2002, Barí¥²t wrote:
> 
> > What i want to do is :
> >
> include("http://localhost/folder/file.php?foo=bar";);
> > but it doesn't work. As you may guess it looks for
> a
> > file called "file.php?foo=bar". "url_fopen" is set
> to
> > "on" in my php.ini file as told in the PHP manual.
> > I work on win98+apache+php4.1.1(or something like
> that
> > but at least 4.1...)
> > Do you know what's the problem?
> > Info about this subject is on
> > http://www.php.net/manual/en/function.include.php
> > ...
> >
> > __
> > Do You Yahoo!?
> > Yahoo! Tax Center - online filing with TurboTax
> > http://taxes.yahoo.com/
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit:
> http://www.php.net/unsub.php
> >
> 


__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Include (Newbie question)

2002-05-25 Thread Kevin Stone

No, not exactly.  The idea behind the include() function in PHP is to append
and execute code to the currently running script.  This is great for
organizing your code into more easier to manage chunks.  PHP will attempt to
parse and execute the included file as a PHP file regardless of the file
extension.  So you can do this for example...

-- myhtml.html --
Hello 
--

-- myphp.php --
$var = "World";

-

This will print out "Hello World".  So that answers two questions with one
stone (err.. yah).  include() is a function not a method.  And you don't
need the  tag to display included html.  The browser will
automatically assume an html header upon any textual output unless otherwise
specified.

Check out the manual for more information.
http://www.php.net/manual/en/function.include.php

Hope this helps
-Kevin

- Original Message -
From: "r" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, May 26, 2002 5:11 AM
Subject: [PHP] Include (Newbie question)


> Hey,
> I have just being going through the manual (windows version) and am a bit
> confused about "include",
> If I want the scope to affect the whole page I do this right:
>
> (example page)
> 
> 
>  include blah.php
> ?>
> some html
>  use some functions to call blah.php
> ?>
> is this correct?
>
> and my second question is if I am including a html file will that file
need
> to have a  etc etc
> or you must have the etc only in one file?
>
> Since am confused about this and it comes straight from the RTFM()
> function.any help appreciated. :-)
>
> Cheers,
> -Ryan.
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Include (Newbie question)

2002-05-25 Thread John Holmes

Also note that if you want PHP in your included()'d file, you have to
put  around the PHP. When you include() a file, PHP starts off
reading it in HTML mode. 

Include() just takes the included file and sticks it into the original
file. The variable scope in an included file is the same as the spot
where the include() was called.

You really only want to call  once in your script. So if it's in
an include()'d file, that's fine. If you calling an included()'d file
from the middle of your script, the include()'d file doesn't have to
have , etc...just valid code.

Take this example. You can use an include file to format a row for a
table.

##include.php##
$data

##main.php##




That'll make 100 table rows for you. 

Include files are good for function declarations and separating pieces
of your HTML apart to easily manage it. 

---John Holmes...

> -Original Message-
> From: Kevin Stone [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, May 25, 2002 8:54 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Include (Newbie question)
> 
> No, not exactly.  The idea behind the include() function in PHP is to
> append
> and execute code to the currently running script.  This is great for
> organizing your code into more easier to manage chunks.  PHP will
attempt
> to
> parse and execute the included file as a PHP file regardless of the
file
> extension.  So you can do this for example...
> 
> -- myhtml.html --
> Hello 
> --
> 
> -- myphp.php --
> $var = "World";
> 
> -
> 
> This will print out "Hello World".  So that answers two questions with
one
> stone (err.. yah).  include() is a function not a method.  And you
don't
> need the  tag to display included html.  The browser will
> automatically assume an html header upon any textual output unless
> otherwise
> specified.
> 
> Check out the manual for more information.
> http://www.php.net/manual/en/function.include.php
> 
> Hope this helps
> -Kevin
> 
> - Original Message -
> From: "r" < >
> To: <[EMAIL PROTECTED]>
> Sent: Sunday, May 26, 2002 5:11 AM
> Subject: [PHP] Include (Newbie question)
> 
> 
> > Hey,
> > I have just being going through the manual (windows version) and am
a
> bit
> > confused about "include",
> > If I want the scope to affect the whole page I do this right:
> >
> > (example page)
> > 
> > 
> >  > include blah.php
> > ?>
> > some html
> >  > use some functions to call blah.php
> > ?>
> > is this correct?
> >
> > and my second question is if I am including a html file will that
file
> need
> > to have a  etc etc
> > or you must have the etc only in one file?
> >
> > Since am confused about this and it comes straight from the RTFM()
> > function.any help appreciated. :-)
> >
> > Cheers,
> > -Ryan.
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Include and memory

2002-06-03 Thread Analysis & Solutions

On Mon, Jun 03, 2002 at 01:49:03PM -0300, Paulo Cesar wrote:

> I'd like to know if the include function alocates the variables that
are in the included file in the memory... and, if it happens, if do I
have a way to access a file with some variables without alocating it in
memory.


Dude, turn line wrapping on in your email program.

Taking the following two bits of information into account should answer 
your question:

1) Variables are put into memory when your code executes the line that
assigns the variable.

2) Stuff in an include file is just like having the included code inside
your script.


So, if you don't want everything going into memory, add some 
conditional statements (like "if" or "switch"), that'll put the stuff 
into memory only when you want it to be in memory.

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Include and memory

2002-06-03 Thread Kevin Stone

No offense but what you just said made absolutely no sense.  There is no way
to perform an operation on a computer without allocating memory for that
operation.  Unlike other lower level prgramming languages (ie. C/C++) PHP
automatically allocates the necessary amount of memory for whatever
operation it is you're doing.  It is completely out of your control.  So I
don't see that there's anything for you to worry about in this regard.
-Kevin

- Original Message -
From: "Paulo Cesar" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 03, 2002 10:49 AM
Subject: [PHP] Include and memory


Hi people...

I'd like to know if the include function alocates the variables that are in
the included file in the memory... and, if it happens, if do I have a way to
access a file with some variables without alocating it in memory.


Tks...


Paulo Cesar




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Include + $Variables Help

2002-06-08 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


* and then Steven declared
> # Is that enough?
> 
> # I then assume this would result in it trying to include 'name.txt',
> # but instead there is always a nasty error about the .txt part.
> # I should probably ask, is passing variables inside an include allowed?
> 
> If I'm wrong, or I'm just missing something that needs to be added, please
> let me know. I'm sooo new at this that I know I'm doing something wrong and
> it is probably very simple. Any help would be greatly appreciated!


Can you show an example of name.txt and the error you get?

I'm guessing but I reckon name.txt should be re written as name.php and
work like this:

 some nice aritcles text marked up here

EOF;
?>

and then in articles.php you should just print $text to where you want
it.

- -- 
Nick Wilson //  www.explodingnet.com



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE9Ah/3HpvrrTa6L5oRAk+iAKCx1lmVO6ZTuzyvyKDYxROcwzK9IgCfaTPS
qtvhmbP4oWg85jueAtfMOIM=
=Bdlq
-END PGP SIGNATURE-

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




  1   2   >