[PHP] include

2001-12-15 Thread jtjohnston

I have a mess of variables I HTML from a couple of different
scripts, so I combined them into an include.inc.

But now, when I do this:

  $news = mysql_query('select * from ccl where ...
order by AU
asc');

  while ($personne = mysql_fetch_object($news))
  {
  include "fields_to_include.inc";
  }

of course my variables I now call in *.inc do not work. ...
So how do I make "$personne->AU" find it's original value
using that
*.inc?


AU; #dedfinitely does not work
I have read the FAQ.
*/

  if($personne->AU != ""){echo"".$personne->AU."\n";}

  if($personne->ST != ""){echo"".$personne->ST."\n";}

  if($personne->SD != ""){echo"".$personne->SD."\n";}

  if($personne->SC != ""){echo"".$personne->SC."\n";}

?>

-- 
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] Include

2001-02-13 Thread Fabian Fabela

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] Include

2001-08-07 Thread Veniamin Goldin

help me please !
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


-- 
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] 'include' & anchors

2002-01-20 Thread Phil Schwarzmann

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] include redirects

2002-01-29 Thread Calin Uioreanu

Hi all,

I have a problem with a redirect. I have a file that includes a content from
another PHP script,
parses the content as string with output buffering and displays it.

The problem is that the include function doesn't seem to handle redirects.
When that other
PHP script makes a Header relocate the fopen from my initial file is lost
and I get
Warning  fopen No such file or directory
I get the same when I try include.

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

--

Regards,
--
Calin Uioreanu
[EMAIL PROTECTED]
Tel: +49 - (0) 89 - 25 55 17 07
http://www.ciao.com
München, Germany
--



-- 
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] include() question

2002-03-14 Thread Phil Schwarzmann

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] Include question

2002-06-01 Thread John Holmes

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] Include question

2002-06-11 Thread Tom Ray

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] include() question...

2002-06-20 Thread Phil Schwarzmann

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] include() problem.

2001-10-23 Thread brendan

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!!!


-- 
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] include help

2001-12-15 Thread jtjohnston

I have a mess of variables I HTML from a couple of different
scripts, so I combined them into an include.inc.

But now, when I do this:

  $news = mysql_query('select * from ccl where ... order by AU
asc');

  while ($personne = mysql_fetch_object($news))
  {
  include "fields_to_include.inc";
  }

of course my variables I now call in *.inc do not work. ...
So how do I make "$personne->AU" find it's original value using that
*.inc?


AU; #dedfinitely does not work
I have read the FAQ.
*/

  if($personne->AU != ""){echo"".$personne->AU."\n";}

  if($personne->ST != ""){echo"".$personne->ST."\n";}

  if($personne->SD != ""){echo"".$personne->SD."\n";}

  if($personne->SC != ""){echo"".$personne->SC."\n";}

?>




-- 
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] Include files

2001-02-12 Thread Conover, Ryan

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]




Fw: [PHP] Include

2001-02-13 Thread Fabian Fabela

Well

The file is not in the same dir, but the php file that is calling it is
using the chdir function to go to that dir, even if I put the file in the
same dir I can't include it.

Thank you.


Fabian Fabela
[EMAIL PROTECTED]
www.vacagorda.com

- Original Message -
From: "Fabian Fabela" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 13, 2001 11:38 AM
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]




-- 
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 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]




[PHP] include file

2001-02-25 Thread JW

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?



-- 
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] include() & require()

2001-03-07 Thread cocos


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


-- 
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] include statement

2001-01-17 Thread Michael Zornek

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:



However I get an error. If I put the absolute it works:



which is scary cause this worked too:



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] include files

2001-02-05 Thread David VanHorn

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] include() suggestion

2001-03-17 Thread Steve Wardell

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.

For anyone who has used Cold Fusion, you'll know what I mean by how this
should work. This would be a MAJOR improvement for making debugging during
development easier. Thanks.

Steve



-- 
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] Include files????

2001-04-02 Thread Bruno Freire

Hi! My name is Bruno.


Anybody can tell me how can i do Include files?
I mean,   Write a function in a file and after this just include this file
in the code, like 
<#include file.h>  of C++?? 

Thanks !!!



[PHP] Include files

2001-04-04 Thread Mike

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] Include Files

2001-04-04 Thread Mike

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] Include Files

2001-04-04 Thread Mike

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] Include Files

2001-04-04 Thread Mike

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] Include / Require

2001-04-05 Thread Ashley M. Kirchner


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] include("../file.inc");

2001-05-11 Thread Matthew Ralston

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] include + path

2001-05-17 Thread Greg Wright

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] include + path

2001-05-17 Thread Greg Wright

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] Include Paths

2001-05-19 Thread Dylan Finney

Hello,

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 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!

Dylan Finney
www.healthcoast.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!!!!!

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]




[PHP] Include & Speed

2001-06-20 Thread mfourny

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   /*
/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*



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]




[PHP] include problem

2001-09-08 Thread mail

Hi

I have a little Problem with include.I want to include a txt file in every php file on 
the server but some php files are in other directories and dont include this txt file.

Example :

Url for the txt file : www.domain.com/include/incl.txt

So www.domain.com/index2.php includes the txt file correctly but 
www.domain.com/shop/shop.php dont do this.

In the include command i used the serverpath to the txt file.

So what should i do ?
Thanks for support !

chris



[PHP] include question

2001-09-17 Thread Scott

Hello everyone-

I am working on a project where a client can upload a template into a database
table and manage it.  The actual HTML code and dynamic code will be in the
template as well.  My hope is to build the page using an include that will
echo the code to the page and then also fill in the dynamic variables.

So, I would grab the template_content from the template database and
print out the template file, then I would also grab the dynamic content from
the content table and it would fill in the template file.

I would prefer to do it with the template in the table so they can manage it,
but I might need to actually write a file out and include it when I create the
page.

Any thoughts?


-- 
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] include question

2001-09-18 Thread Nikola Veber

Hi !

I'm using include() function to print html code nested in a function in the included 
file when a link is selected. I was wondering if the whole php file that is included 
gets loaded, or the server just sends the code from desired finction? Can I put 
more than one function full of html code in one file without fear that each time user 
will have to wait for the whole php to load ?
exp:
if(){
include("file.php")//is the whole file.php loaded, or just the function() ?
function_with_html_code_in_it();
} 
Thanks
Nikola



-- 
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] include() problem...

2001-09-20 Thread Matthew Walker

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




[PHP] include with call

2002-01-13 Thread John Cuthbert

Hello,
I have a file which does several different things depending on how its
called Ie
file?mode=show is to show it etc

But I want to include the output from the show so  I tried
 but this causes errors. It goes away
with including as only file.php but doing that also causes problems because
mode isnt set yet.

Anyone know how to get around this?



-- 
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] Include() and URLs

2002-01-17 Thread John (News)

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?

Note: I'm using PHP for Windows v4.0.6. This command runs fine on my Linux 
box using the same build so I assume it's a configuration problem.

Hippie.



[PHP] include() and URL's

2002-01-17 Thread Hippie

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]




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]




[PHP] include() and paths

2002-03-01 Thread Nick Wilson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi all, 
Here's the scenario.

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.
Simple (I hope)

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.


Many thanks

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

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

iD8DBQE8f1VMHpvrrTa6L5oRAogTAJ46IwBbwFVLnVhNEG2qIj9ZqzXX1QCeMinj
6Y7FWqh5wFGqVEYe58LkZTM=
=YtcD
-END PGP SIGNATURE-

-- 
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 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




[PHP] include through HTTP

2002-04-12 Thread Barýþ

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] Include (Newbie question)

2002-05-25 Thread r

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)



some html

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] PHP Include directory

2002-05-27 Thread Tim Thorburn

Hi,

I'm trying to setup an include directory for my site using .htaccess but 
I'm having some difficulties.

The command I'm typing is as follows:
php_value include_dir ".:/path/to/my/site/includes"

When I try this, I get an error 500 with Apache.  Have I typed something wrong?

Here's my setup:
Apache 1.3.12
PHP 3.0.18
Sun Solaris

Thanks
-Tim



-- 
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




[PHP] Include and memory

2002-06-03 Thread Paulo Cesar

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] include/require porblem

2002-06-04 Thread Mitja Pagon

I have the following problem.

code of index.php
---
 0)) {
  include_once(ROOT."/admin/main.php");
 } else {
  header("Location: " . generate_URL("/admin/login"));
 }#end if
?>
---
File "dvojka_root.inc" defines a single constant called ROOT (path to the
wwwroot) used for other includes
File "admin_func.inc" has some functions that are commonly used.

When trying to use constant ROOT in "main.php" (to include "head.inc") i get
an error code, since ROOT is not defined.

code of main.php






  
  


  






in a similar case, i set up to test this scenario (using constants definded
in one include in the other), everything work fine, what's wrong???


Thanks!

Mitja Pagon




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




[PHP] include/require porblem

2002-06-04 Thread Mitja Pagon

I have the following problem.

code of index.php
---
 0)) {
  include_once(ROOT."/admin/main.php");
 } else {
  header("Location: " . generate_URL("/admin/login"));
 }#end if
?>
---
File "dvojka_root.inc" defines a single constant called ROOT (path to the
wwwroot) used for other includes
File "admin_func.inc" has some functions that are commonly used.

When trying to use constant ROOT in "main.php" (to include "head.inc") i get
an error code, since ROOT is not defined.

code of main.php






  
  


  






in a similar case, i set up to test this scenario (using constants definded
in one include in the other), everything work fine, what's wrong???


Thanks!

Mitja Pagon




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




[PHP] Include + $Variables Help

2002-06-08 Thread Steven

Here's my problem:

I'm trying to make a simple publication of 30+ articles, using PHP but not
MySQL.

There are basically three components:
 - a table of contents (contents.html)
 - an article template (article.php)
 - and then 30+ text files.

The idea I was going for was to make dynamic links in contents.html that
would pass a variable to article.php. The article page then uses that
variable in an include( ). Does this make sense? I.e.-

## contents.html
Text Link

## article.php
# The link above would then pass the $auth variable as 'name', right?
# 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!

Thanks in advance.

SB



-- 
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




[PHP] INCLUDE vs Functions

2002-06-27 Thread Jeff Gannaway

I'm re-writing a medium-sized commercial site in PHP.  There will be 
elements that will on nearly every page.  I was considering writing each 
element as a program and then using INCLUDE statements wherever I wanted 
that element displayed.  Now I'm wondering if grouping all those elements 
into 1 file and defining them as functions would save on system resources 
and improve speed.

In other words is


More or less efficient than...


Thanks,
Jeff Gannaway
"It's a feeling of fresh opportunity. You're placed in a position a lot of 
times where not only you're wanted, but where God feels you're needed."

-Jalen Rose on being traded to the Bulls


-- 
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]




[PHP] include "http" problem

2001-11-20 Thread Mike Webby

include ("http://www.somesite.com/somepage.html";);

Worked perfect on our unix box and our win98 machines but when we installed PHP on our
Windows server it no longer worked and tottaly ignored the include unless we used the 
path
instead like.

include ("somepage.html"); 

[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&#

[PHP] Include statement problems

2001-01-21 Thread Si Wizard

Hey,
  I just signed up on this list.  I've got a quick
question.

I am using an #include statment, and here it is:

include.html
---

---

so when I include it looks like this
---
include.html?page=main.html
---

That way the page shown in the include statement is
main.html

My problem comes when the page I am including is
passing vars as well.

ie
---
include.html?page=main.html?date=12
---

I get an error msg saying that it could not include my
file.


Any ideas?  Work arounds?  I am using PHP3.

Thanks,

Eric Padgett


__
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices. 
http://auctions.yahoo.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 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]




  1   2   3   >