Re: [PHP-DB] Include function across servers

2007-04-03 Thread Micah Stevens
No. That would be to access the code. Include grabs an entire file. 
Perhaps you should look into Ajax techniques.


-Micah

On 04/02/2007 04:06 PM, ioannes wrote:
I have a particular business application so just returning html is OK, 
the output is the useful bit in this case.  I understand from the 
discussion that I can still run my code on my server in response to a 
remote server requesting the result of a function in that file and 
that result gets back to that server.  So you can use include() to 
access the result of a function on another server, sounds like.




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



Re: [PHP-DB] Include function across servers

2007-04-02 Thread Chris

ioannes wrote:
I have a particular business application so just returning html is OK, 
the output is the useful bit in this case.  I understand from the 
discussion that I can still run my code on my server in response to a 
remote server requesting the result of a function in that file and that 
result gets back to that server.  So you can use include() to access the 
result of a function on another server, sounds like.


You can include code, but you can't run a function from another server.

That code could include a function but that doesn't mean you'll get the 
right results from it.


For example:




including that from a remote server will query your local database - it 
will not query your remote database.


So I really suggest finding another way to do whatever you are trying to 
do...


1) for security reasons (you don't want anyone else to be able to access 
your database or anything else because if you can do it, so can I - plus 
a lot of other things to get into your server)


2) for practicality reasons (eg the above)

3) for usability reasons (eg the remote server crashes, your 
website/whatever is inaccessible because functionality can't be retrieved)


--
Postgresql & php tutorials
http://www.designmagick.com/

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



Re: [PHP-DB] Include function across servers

2007-04-02 Thread Bastien Koert

use cURL to execute the remote code

Bastien



From: ioannes <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: php-db@lists.php.net
Subject: Re: [PHP-DB] Include function across servers
Date: Tue, 03 Apr 2007 00:06:25 +0100

I have a particular business application so just returning html is OK, the 
output is the useful bit in this case.  I understand from the discussion 
that I can still run my code on my server in response to a remote server 
requesting the result of a function in that file and that result gets back 
to that server.  So you can use include() to access the result of a 
function on another server, sounds like.


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



_
RealLiveMoms: Share your experience with Real Live Moms just like you 
http://www.reallivemoms.ca/


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



Re: [PHP-DB] Include function across servers

2007-04-02 Thread ioannes
I have a particular business application so just returning html is OK, 
the output is the useful bit in this case.  I understand from the 
discussion that I can still run my code on my server in response to a 
remote server requesting the result of a function in that file and that 
result gets back to that server.  So you can use include() to access the 
result of a function on another server, sounds like.


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



Re: [PHP-DB] Include function across servers

2007-04-02 Thread Tony Miceli
thanks for your reply. that's what i figured using common sense, but that's 
not always the case with software.


cu
tony
 
My email address has changed. It is now [EMAIL PROTECTED] Visit my website
- Original Message - 
From: "Chris" <[EMAIL PROTECTED]>

To: "Tony Miceli" <[EMAIL PROTECTED]>
Cc: 
Sent: Monday, April 02, 2007 6:24 PM
Subject: Re: [PHP-DB] Include function across servers



Tony Miceli wrote:
wouldn't that be very dangerous if someone could grab my code and run it 
on their server?


Yeh, pretty dangerous. That's how c99shell and a bunch of other scripts 
work.


i'm an intermediate php guy at best. for many reasons i would not want 
someone including my files and running them on another server!!! i hope 
there's no easy way to do that!


If they are named with an extension that isn't parsed by php (eg .txt), 
then they will be executed on another server.


If they are parsed by php (ie .php) then including them remotely won't 
work - it will include whatever your php script spits out (eg html).


btw if files are outside of the route directory then that means only the 
local files can all them and execute them, right??


Right.

--
Postgresql & php tutorials
http://www.designmagick.com/ 


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



Re: [PHP-DB] Include function across servers

2007-04-02 Thread Chris

Tony Miceli wrote:
wouldn't that be very dangerous if someone could grab my code and run it 
on their server?


Yeh, pretty dangerous. That's how c99shell and a bunch of other scripts 
work.


i'm an intermediate php guy at best. for many reasons i would not want 
someone including my files and running them on another server!!! i hope 
there's no easy way to do that!


If they are named with an extension that isn't parsed by php (eg .txt), 
then they will be executed on another server.


If they are parsed by php (ie .php) then including them remotely won't 
work - it will include whatever your php script spits out (eg html).


btw if files are outside of the route directory then that means only the 
local files can all them and execute them, right??


Right.

--
Postgresql & php tutorials
http://www.designmagick.com/

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



Re: [PHP-DB] Include function across servers

2007-04-02 Thread Tony Miceli
wouldn't that be very dangerous if someone could grab my code and run it on 
their server?


i'm an intermediate php guy at best. for many reasons i would not want 
someone including my files and running them on another server!!! i hope 
there's no easy way to do that!


btw if files are outside of the route directory then that means only the 
local files can all them and execute them, right??


thanks
tony


 
My email address has changed. It is now [EMAIL PROTECTED] Visit my website
- Original Message - 
From: "Micah Stevens" <[EMAIL PROTECTED]>

To: <[EMAIL PROTECTED]>
Cc: 
Sent: Monday, April 02, 2007 4:20 PM
Subject: Re: [PHP-DB] Include function across servers



I'm not totally clear on what you're asking, so here's two options:

If you use the include() function, you're pulling the code from the 
external server and running on the local server. If you're running an HTTP 
call, say via an Ajax routine for example, the code runs on the external 
server.


The difference is if you're grabbing the source from the external server 
and running it on the local php interpreter, or if you're using the 
external php setup.


This seems to be what you're asking, the answer in this case is, either 
one could happen, it depends on your implementation. If you provide 
details on the exact implementation then I can give a more exact answer.


HTH,
-Micah

On 04/02/2007 06:53 AM, ioannes wrote:
I ask this as I do not have two web sites on different servers to test at 
the moment.
Does it work to use an include function in the php code on one site that 
calls a function on the other site?  If you include a file on a remote 
server that runs a function, where does the function run - on the server 
where the function is originally written or on the calling server?  I am 
thinking that if I write code, it is one way to make the functionality 
available without actually disposing of the source code itself.


So the included functions might be variable values.  Eg you could pass 
back a whole calendar to the calling server, which then just prints on 
the calling web site just by printing the returned variable.  (I know 
that in terms of getting data to mark up the calendar the database would 
need to be fully referenced: user, password, server, and the calling 
(shared) host for instance will ask for the remote IP address to add to a 
white list.)


John



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



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



Re: [PHP-DB] Include function across servers

2007-04-02 Thread Micah Stevens

I'm not totally clear on what you're asking, so here's two options:

If you use the include() function, you're pulling the code from the 
external server and running on the local server. If you're running an 
HTTP call, say via an Ajax routine for example, the code runs on the 
external server.


The difference is if you're grabbing the source from the external server 
and running it on the local php interpreter, or if you're using the 
external php setup.


This seems to be what you're asking, the answer in this case is, either 
one could happen, it depends on your implementation. If you provide 
details on the exact implementation then I can give a more exact answer.


HTH,
-Micah

On 04/02/2007 06:53 AM, ioannes wrote:
I ask this as I do not have two web sites on different servers to test 
at  the moment.
Does it work to use an include function in the php code on one site 
that calls a function on the other site?  If you include a file on a 
remote server that runs a function, where does the function run - on 
the server where the function is originally written or on the calling 
server?  I am thinking that if I write code, it is one way to make the 
functionality available without actually disposing of the source code 
itself.


So the included functions might be variable values.  Eg you could pass 
back a whole calendar to the calling server, which then just prints on 
the calling web site just by printing the returned variable.  (I know 
that in terms of getting data to mark up the calendar the database 
would need to be fully referenced: user, password, server, and the 
calling (shared) host for instance will ask for the remote IP address 
to add to a white list.)


John



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



[PHP-DB] Include function across servers

2007-04-02 Thread ioannes
I ask this as I do not have two web sites on different servers to test 
at  the moment. 

Does it work to use an include function in the php code on one site that 
calls a function on the other site?  If you include a file on a remote 
server that runs a function, where does the function run - on the server 
where the function is originally written or on the calling server?  I am 
thinking that if I write code, it is one way to make the functionality 
available without actually disposing of the source code itself.


So the included functions might be variable values.  Eg you could pass 
back a whole calendar to the calling server, which then just prints on 
the calling web site just by printing the returned variable.  (I know 
that in terms of getting data to mark up the calendar the database would 
need to be fully referenced: user, password, server, and the calling 
(shared) host for instance will ask for the remote IP address to add to 
a white list.)


John

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



[PHP-DB] Include Files Solution

2004-04-22 Thread Robert Sossomon
Here's the solution I came up with that works for the site:


   $display_block .= "";


I am only using the PHP parser once instead of twice, the \n makes the
whole thing nicely readable in the HTML source files that are generated,
and the paths were modified (and the navigation templates were as well)
to give the correct paths to all the images and files concerned.

The biggest reason I had path problems was that I set the page
generation in the home directory, the generated pages in their own
directory (as well as the rest of the pieces of the online catalog quote
request form) and the navigation sits in it's own directory off the root
folder.

/
 page generation
/catalog
 pages
/nav
 templates
/images
 images
/product_images
 images

What had me perplexed was I coded the product images correctly to work
right from the beginning with the leading '/' character and so since I
did it correct at the beginning it should hold true that I coded it
correctly throughout, right?  WRONG!  I completely bungled the whole
paths and was left with a bunch of garbage.  Now I have the paths all
loaded correctly, the templates were all modified to call images and
pages with a leading '/' character, and everything is working fluidly.

Now I'm ready to call it a week and go to the beach!!!  Who's with me?!

BTW, if you want to see the output pages then feel free to click here:
http://www.pfssales.com/catalog.html and click on any of the links.

Robert

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



Re: [PHP-DB] include function

2004-04-07 Thread Craig Hoffman
Ok, I figured it out.  I am using jpgraph and I need to place the 
include statement next to the start of PHP.


v: (847) 644 - 8914
f: (847) 866 - 1946
e: [EMAIL PROTECTED]
w: www.eclimb.net
_
On Apr 6, 2004, at 10:24 PM, Craig Hoffman wrote:
Someone tell me why this isn't working? I keep getting a parser error 
on line 36 (the last include).   I'm running PHP 4.3.5 if that helps.

include ("include/dbadmin.php");
include ("jpgraph/src/jpgraph.php");   
include ("jpgraph/src/jpgraph_bar.php");
Parse error: parse error, unexpected T_INCLUDE in 
/Users/choffman/Sites/www/cyclistsedge/top_performace.php on line 36

__
Craig Hoffman - eClimb Media
v: (847) 644 - 8914
f: (847) 866 - 1946
e: [EMAIL PROTECTED]
w: www.eclimb.net
_
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] include function

2004-04-06 Thread Marcjon Louwersheimer
did you make sure the previous line had a ; at the end? Check that first.


- Original message -
From: "Craig Hoffman" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Date: Tue, 6 Apr 2004 22:24:27 -0500
Subject: [PHP-DB] include function

Someone tell me why this isn't working? I keep getting a parser error 
on line 36 (the last include).   I'm running PHP 4.3.5 if that helps.

include ("include/dbadmin.php");
include ("jpgraph/src/jpgraph.php");   
include ("jpgraph/src/jpgraph_bar.php");

Parse error: parse error, unexpected T_INCLUDE in 
/Users/choffman/Sites/www/cyclistsedge/top_performace.php on line 36

__
Craig Hoffman - eClimb Media

v: (847) 644 - 8914
f: (847) 866 - 1946
e: [EMAIL PROTECTED]
w: www.eclimb.net
_
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
  Marcjon

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



[PHP-DB] include function

2004-04-06 Thread Craig Hoffman
Someone tell me why this isn't working? I keep getting a parser error 
on line 36 (the last include).   I'm running PHP 4.3.5 if that helps.

include ("include/dbadmin.php");
include ("jpgraph/src/jpgraph.php");   
include ("jpgraph/src/jpgraph_bar.php");
Parse error: parse error, unexpected T_INCLUDE in 
/Users/choffman/Sites/www/cyclistsedge/top_performace.php on line 36

__
Craig Hoffman - eClimb Media
v: (847) 644 - 8914
f: (847) 866 - 1946
e: [EMAIL PROTECTED]
w: www.eclimb.net
_
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Include a file into a database table !!!!

2003-09-21 Thread Ignacio Echegoyen
Hy everybody,

   I´m a new php user and I looking for a
solution to receive the following information from my site:

1) I want to received a form with text fields + a file (up to 100 k)

I need to know wich is the easy way to place this service in my
site. The question is if I can receive a file into a table column ?

It´s a product to place the file into some directory in the site
and the text fields into a table, but isn´t free. So the other question if
is possible to have the same capability with a sareware product ???

Thanks a lot
Ignacio

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



Re: [PHP-DB] include() statement hell!

2002-03-28 Thread Brad Melendy

I'll do that Jonathan.  I want to thank you again, and everyone else that
gave me suggestions.  I think I finally understand all the 'rules' about the
include statement AND that I've got to keep a close eye on my typos.  Thanks
once again!

...Brad :-)

"Jonathan Hilgeman" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> You should also put quotes around your keys in your arrays if they're
> non-numeric. For instance:
> $session["logged_in"] instead of $session[logged_in]
>
> It's good coding habit, and it sometimes will save you from some
"constant"
> headaches (pun intended for everyone who has run into this problem
before).
>
> - Jonathan
>
>
>
> -Original Message-
> From: Brad Melendy [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, March 28, 2002 12:06 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP-DB] include() statement hell!
>
>
> Thanks Jonathan,
> Your suggestions were very helpful, especially turning on the error
logging.
> Here is where I'm at now:
>
> Files in use:
> /include/dblib.inc
> /include/userlib.inc
> /main/page.php
>
> My include statements in /main/page.php:
> include("../include/dblib.inc");
> include("../include/userlib.inc");
>
> All the fuctions I call from dblib.inc work great, however, I have only a
> single function in userlib.inc and it generates an error.  The error I get
> is:
>
> Fatal error: Call to undefined function: cleansession()
>
> Here is the file userlib.inc:
>
>  session_start();
> session_register( "session" );
>
> function cleanSession( $id, $login, $pass )
>  {
>  global $session;
>  $session[id] = $id;
>  $session[login] = $login;
>  $session[password] = $pass;
>  $session[logged_in] = true;
>  }
> ?>
>
> Lastly, if I paste the above function  into page.php (without the
> session_start and session_register lines) it works fine.  I've tried
giving
> the function a different name, changing case, all sorts of stuff.  I've
> tried renaming it to userlib.php and I've opened the file directly in my
> browser with the error_reporting(2039); at the top and no error messages,
> yet it is as if the file never gets included.  I've tried including ONLY
> userlib.inc and pasting all the dblib.inc functions into page.php (to rule
> out dblib.inc screwing things up) and still I get the error.
>
> I am truly confounded at this point.  Thanks for any suggestions you have.
> I think I am almost out of "Include Statement Hell".  ;-)
>
> ...Brad
>
> "Jonathan Hilgeman" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > So, maybe this is the question.  Can you include a file from
> > > /main/page.php by using a path of /includes/dblib.inc?
> >
> > Probably not. PHP can "see" the whole filesystem, not just the area that
> is
> > limited to your account. So, when you try to include
"/includes/dblib.inc"
> > it is trying to go down to the SYSTEM root and open up a subdirectory
> called
> > includes and get the file dblib.inc inside it.
> >
> > If you copy the dblib.inc to the same directory as page.php, you should
> only
> > have to say:
> >  include("dblib.inc");
> >
> > However, if you have this layout:
> >  /your/account/dir/main/page.php
> >  /your/account/dir/includes/dblib.inc
> >  /your/account/dir/includes/userlib.inc
> >
> > Then page.php would have to say:
> >  include("../includes/dblib.inc");
> >
> > Which would go back one directory, THEN into the includes subdirectory,
> and
> > then it could find dblib.inc
> >
> > I would definitely add:
> >  error_reporting(2039);
> >
> > ...to the top of your page.php code to see if you can pick up any
errors.
> > Also, check your error log if you have one (contact your hosting company
> if
> > you're not sure).
> >
> > I would definitely try to solve this the normal way by finding the
problem
> > with the paths rather than trying to screw with your php.ini or
httpd.conf
> > file - otherwise you'll have a script that might not work if you ever
have
> > to move your scripts or copy them to a development server or something.
> >
> > - Jonathan
> >
> > -Original Message-
> > From: Brad Melendy [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, March 27, 2002 7:27 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [PHP-DB] include() statement hell!
> >
> >
> &

RE: [PHP-DB] include() statement hell!

2002-03-28 Thread Jonathan Hilgeman

No problem. I wonder if there's a web-based syntax checker for PHP...

- Jonathan

-Original Message-
From: Brad Melendy [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 28, 2002 12:23 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] include() statement hell!


Man, this means I have to walk around the block with a sign on my back
saying, "I'm a %*$&-ASS" for letting that one get by.  ;-)  Thanks a ton
Jonathan.  It of course, works now.  I think it will be a while before I
make that mistake again.

...Brad

"Jonathan Hilgeman" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> This might be your problem:
> 
> Try:
> 
> :)
>
> - Jonathan
>
> -Original Message-
> From: Brad Melendy [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, March 28, 2002 12:06 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP-DB] include() statement hell!
>
>
> Thanks Jonathan,
> Your suggestions were very helpful, especially turning on the error
logging.
> Here is where I'm at now:
>
> Files in use:
> /include/dblib.inc
> /include/userlib.inc
> /main/page.php
>
> My include statements in /main/page.php:
> include("../include/dblib.inc");
> include("../include/userlib.inc");
>
> All the fuctions I call from dblib.inc work great, however, I have only a
> single function in userlib.inc and it generates an error.  The error I get
> is:
>
> Fatal error: Call to undefined function: cleansession()
>
> Here is the file userlib.inc:
>
>  session_start();
> session_register( "session" );
>
> function cleanSession( $id, $login, $pass )
>  {
>  global $session;
>  $session[id] = $id;
>  $session[login] = $login;
>  $session[password] = $pass;
>  $session[logged_in] = true;
>  }
> ?>
>
> Lastly, if I paste the above function  into page.php (without the
> session_start and session_register lines) it works fine.  I've tried
giving
> the function a different name, changing case, all sorts of stuff.  I've
> tried renaming it to userlib.php and I've opened the file directly in my
> browser with the error_reporting(2039); at the top and no error messages,
> yet it is as if the file never gets included.  I've tried including ONLY
> userlib.inc and pasting all the dblib.inc functions into page.php (to rule
> out dblib.inc screwing things up) and still I get the error.
>
> I am truly confounded at this point.  Thanks for any suggestions you have.
> I think I am almost out of "Include Statement Hell".  ;-)
>
> ...Brad
>
> "Jonathan Hilgeman" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > So, maybe this is the question.  Can you include a file from
> > > /main/page.php by using a path of /includes/dblib.inc?
> >
> > Probably not. PHP can "see" the whole filesystem, not just the area that
> is
> > limited to your account. So, when you try to include
"/includes/dblib.inc"
> > it is trying to go down to the SYSTEM root and open up a subdirectory
> called
> > includes and get the file dblib.inc inside it.
> >
> > If you copy the dblib.inc to the same directory as page.php, you should
> only
> > have to say:
> >  include("dblib.inc");
> >
> > However, if you have this layout:
> >  /your/account/dir/main/page.php
> >  /your/account/dir/includes/dblib.inc
> >  /your/account/dir/includes/userlib.inc
> >
> > Then page.php would have to say:
> >  include("../includes/dblib.inc");
> >
> > Which would go back one directory, THEN into the includes subdirectory,
> and
> > then it could find dblib.inc
> >
> > I would definitely add:
> >  error_reporting(2039);
> >
> > ...to the top of your page.php code to see if you can pick up any
errors.
> > Also, check your error log if you have one (contact your hosting company
> if
> > you're not sure).
> >
> > I would definitely try to solve this the normal way by finding the
problem
> > with the paths rather than trying to screw with your php.ini or
httpd.conf
> > file - otherwise you'll have a script that might not work if you ever
have
> > to move your scripts or copy them to a development server or something.
> >
> > - Jonathan
> >
> > -Original Message-
> > From: Brad Melendy [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, March 27, 2002 7:27 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [PHP-DB] include() statement hell!
> >
> >
> > Thanks Jonathan,
> > I&#x

Re: [PHP-DB] include() statement hell!

2002-03-28 Thread Brad Melendy

Man, this means I have to walk around the block with a sign on my back
saying, "I'm a %*$&-ASS" for letting that one get by.  ;-)  Thanks a ton
Jonathan.  It of course, works now.  I think it will be a while before I
make that mistake again.

...Brad

"Jonathan Hilgeman" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> This might be your problem:
> 
> Try:
> 
> :)
>
> - Jonathan
>
> -Original Message-
> From: Brad Melendy [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, March 28, 2002 12:06 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP-DB] include() statement hell!
>
>
> Thanks Jonathan,
> Your suggestions were very helpful, especially turning on the error
logging.
> Here is where I'm at now:
>
> Files in use:
> /include/dblib.inc
> /include/userlib.inc
> /main/page.php
>
> My include statements in /main/page.php:
> include("../include/dblib.inc");
> include("../include/userlib.inc");
>
> All the fuctions I call from dblib.inc work great, however, I have only a
> single function in userlib.inc and it generates an error.  The error I get
> is:
>
> Fatal error: Call to undefined function: cleansession()
>
> Here is the file userlib.inc:
>
>  session_start();
> session_register( "session" );
>
> function cleanSession( $id, $login, $pass )
>  {
>  global $session;
>  $session[id] = $id;
>  $session[login] = $login;
>  $session[password] = $pass;
>  $session[logged_in] = true;
>  }
> ?>
>
> Lastly, if I paste the above function  into page.php (without the
> session_start and session_register lines) it works fine.  I've tried
giving
> the function a different name, changing case, all sorts of stuff.  I've
> tried renaming it to userlib.php and I've opened the file directly in my
> browser with the error_reporting(2039); at the top and no error messages,
> yet it is as if the file never gets included.  I've tried including ONLY
> userlib.inc and pasting all the dblib.inc functions into page.php (to rule
> out dblib.inc screwing things up) and still I get the error.
>
> I am truly confounded at this point.  Thanks for any suggestions you have.
> I think I am almost out of "Include Statement Hell".  ;-)
>
> ...Brad
>
> "Jonathan Hilgeman" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > So, maybe this is the question.  Can you include a file from
> > > /main/page.php by using a path of /includes/dblib.inc?
> >
> > Probably not. PHP can "see" the whole filesystem, not just the area that
> is
> > limited to your account. So, when you try to include
"/includes/dblib.inc"
> > it is trying to go down to the SYSTEM root and open up a subdirectory
> called
> > includes and get the file dblib.inc inside it.
> >
> > If you copy the dblib.inc to the same directory as page.php, you should
> only
> > have to say:
> >  include("dblib.inc");
> >
> > However, if you have this layout:
> >  /your/account/dir/main/page.php
> >  /your/account/dir/includes/dblib.inc
> >  /your/account/dir/includes/userlib.inc
> >
> > Then page.php would have to say:
> >  include("../includes/dblib.inc");
> >
> > Which would go back one directory, THEN into the includes subdirectory,
> and
> > then it could find dblib.inc
> >
> > I would definitely add:
> >  error_reporting(2039);
> >
> > ...to the top of your page.php code to see if you can pick up any
errors.
> > Also, check your error log if you have one (contact your hosting company
> if
> > you're not sure).
> >
> > I would definitely try to solve this the normal way by finding the
problem
> > with the paths rather than trying to screw with your php.ini or
httpd.conf
> > file - otherwise you'll have a script that might not work if you ever
have
> > to move your scripts or copy them to a development server or something.
> >
> > - Jonathan
> >
> > -Original Message-
> > From: Brad Melendy [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, March 27, 2002 7:27 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [PHP-DB] include() statement hell!
> >
> >
> > Thanks Jonathan,
> > I'm trying to include a file /includes/dblib.inc from /main/page.php.
In
> > /main/page.php I use include("includes/dblib.inc");.  When that didn't
> work,
> > I tried copying the file to /main/ and including it there and that
didn't
> >

RE: [PHP-DB] include() statement hell!

2002-03-28 Thread Jonathan Hilgeman

You should also put quotes around your keys in your arrays if they're
non-numeric. For instance:
$session["logged_in"] instead of $session[logged_in]

It's good coding habit, and it sometimes will save you from some "constant"
headaches (pun intended for everyone who has run into this problem before).

- Jonathan



-Original Message-
From: Brad Melendy [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 28, 2002 12:06 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] include() statement hell!


Thanks Jonathan,
Your suggestions were very helpful, especially turning on the error logging.
Here is where I'm at now:

Files in use:
/include/dblib.inc
/include/userlib.inc
/main/page.php

My include statements in /main/page.php:
include("../include/dblib.inc");
include("../include/userlib.inc");

All the fuctions I call from dblib.inc work great, however, I have only a
single function in userlib.inc and it generates an error.  The error I get
is:

Fatal error: Call to undefined function: cleansession()

Here is the file userlib.inc:



Lastly, if I paste the above function  into page.php (without the
session_start and session_register lines) it works fine.  I've tried giving
the function a different name, changing case, all sorts of stuff.  I've
tried renaming it to userlib.php and I've opened the file directly in my
browser with the error_reporting(2039); at the top and no error messages,
yet it is as if the file never gets included.  I've tried including ONLY
userlib.inc and pasting all the dblib.inc functions into page.php (to rule
out dblib.inc screwing things up) and still I get the error.

I am truly confounded at this point.  Thanks for any suggestions you have.
I think I am almost out of "Include Statement Hell".  ;-)

...Brad

"Jonathan Hilgeman" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > So, maybe this is the question.  Can you include a file from
> > /main/page.php by using a path of /includes/dblib.inc?
>
> Probably not. PHP can "see" the whole filesystem, not just the area that
is
> limited to your account. So, when you try to include "/includes/dblib.inc"
> it is trying to go down to the SYSTEM root and open up a subdirectory
called
> includes and get the file dblib.inc inside it.
>
> If you copy the dblib.inc to the same directory as page.php, you should
only
> have to say:
>  include("dblib.inc");
>
> However, if you have this layout:
>  /your/account/dir/main/page.php
>  /your/account/dir/includes/dblib.inc
>  /your/account/dir/includes/userlib.inc
>
> Then page.php would have to say:
>  include("../includes/dblib.inc");
>
> Which would go back one directory, THEN into the includes subdirectory,
and
> then it could find dblib.inc
>
> I would definitely add:
>  error_reporting(2039);
>
> ...to the top of your page.php code to see if you can pick up any errors.
> Also, check your error log if you have one (contact your hosting company
if
> you're not sure).
>
> I would definitely try to solve this the normal way by finding the problem
> with the paths rather than trying to screw with your php.ini or httpd.conf
> file - otherwise you'll have a script that might not work if you ever have
> to move your scripts or copy them to a development server or something.
>
> - Jonathan
>
> -Original Message-
> From: Brad Melendy [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, March 27, 2002 7:27 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP-DB] include() statement hell!
>
>
> Thanks Jonathan,
> I'm trying to include a file /includes/dblib.inc from /main/page.php.  In
> /main/page.php I use include("includes/dblib.inc");.  When that didn't
work,
> I tried copying the file to /main/ and including it there and that didn't
> work either.  Finally, I tried adding a specific path to the php.ini file
> for includes_path and put the files there and that worked.  Then I went
and
> changed the php.ini file to remove the reference (still trying to get it
to
> work the way I THINK it should) and then it WORKED!  But ONLY from within
> /main/.  Each time I make these changes, I am making a matching change in
> the actual include() statement at the top of /main/page.php and I am
> restarting apache each time I change php.ini.
>
> So, maybe this is the question.  Can you include a file from
/main/page.php
> by using a path of /includes/dblib.inc?
>
> dblib.inc has functions that do connections and queries to a mysql
database.
> Even stranger yet, is that I have one other include file called
userlib.inc
> that has authentication related session functions.  Well, that hasn't
worked
> at all no 

RE: [PHP-DB] include() statement hell!

2002-03-28 Thread Jonathan Hilgeman

This might be your problem:
mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 28, 2002 12:06 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] include() statement hell!


Thanks Jonathan,
Your suggestions were very helpful, especially turning on the error logging.
Here is where I'm at now:

Files in use:
/include/dblib.inc
/include/userlib.inc
/main/page.php

My include statements in /main/page.php:
include("../include/dblib.inc");
include("../include/userlib.inc");

All the fuctions I call from dblib.inc work great, however, I have only a
single function in userlib.inc and it generates an error.  The error I get
is:

Fatal error: Call to undefined function: cleansession()

Here is the file userlib.inc:



Lastly, if I paste the above function  into page.php (without the
session_start and session_register lines) it works fine.  I've tried giving
the function a different name, changing case, all sorts of stuff.  I've
tried renaming it to userlib.php and I've opened the file directly in my
browser with the error_reporting(2039); at the top and no error messages,
yet it is as if the file never gets included.  I've tried including ONLY
userlib.inc and pasting all the dblib.inc functions into page.php (to rule
out dblib.inc screwing things up) and still I get the error.

I am truly confounded at this point.  Thanks for any suggestions you have.
I think I am almost out of "Include Statement Hell".  ;-)

...Brad

"Jonathan Hilgeman" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > So, maybe this is the question.  Can you include a file from
> > /main/page.php by using a path of /includes/dblib.inc?
>
> Probably not. PHP can "see" the whole filesystem, not just the area that
is
> limited to your account. So, when you try to include "/includes/dblib.inc"
> it is trying to go down to the SYSTEM root and open up a subdirectory
called
> includes and get the file dblib.inc inside it.
>
> If you copy the dblib.inc to the same directory as page.php, you should
only
> have to say:
>  include("dblib.inc");
>
> However, if you have this layout:
>  /your/account/dir/main/page.php
>  /your/account/dir/includes/dblib.inc
>  /your/account/dir/includes/userlib.inc
>
> Then page.php would have to say:
>  include("../includes/dblib.inc");
>
> Which would go back one directory, THEN into the includes subdirectory,
and
> then it could find dblib.inc
>
> I would definitely add:
>  error_reporting(2039);
>
> ...to the top of your page.php code to see if you can pick up any errors.
> Also, check your error log if you have one (contact your hosting company
if
> you're not sure).
>
> I would definitely try to solve this the normal way by finding the problem
> with the paths rather than trying to screw with your php.ini or httpd.conf
> file - otherwise you'll have a script that might not work if you ever have
> to move your scripts or copy them to a development server or something.
>
> - Jonathan
>
> -Original Message-
> From: Brad Melendy [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, March 27, 2002 7:27 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP-DB] include() statement hell!
>
>
> Thanks Jonathan,
> I'm trying to include a file /includes/dblib.inc from /main/page.php.  In
> /main/page.php I use include("includes/dblib.inc");.  When that didn't
work,
> I tried copying the file to /main/ and including it there and that didn't
> work either.  Finally, I tried adding a specific path to the php.ini file
> for includes_path and put the files there and that worked.  Then I went
and
> changed the php.ini file to remove the reference (still trying to get it
to
> work the way I THINK it should) and then it WORKED!  But ONLY from within
> /main/.  Each time I make these changes, I am making a matching change in
> the actual include() statement at the top of /main/page.php and I am
> restarting apache each time I change php.ini.
>
> So, maybe this is the question.  Can you include a file from
/main/page.php
> by using a path of /includes/dblib.inc?
>
> dblib.inc has functions that do connections and queries to a mysql
database.
> Even stranger yet, is that I have one other include file called
userlib.inc
> that has authentication related session functions.  Well, that hasn't
worked
> at all no matter what, unless I put the functions in /includes/userlib.inc
> directly into the file /main/page.php.  Once there, all the functions work
> fine.  Otherwise, the only error messages I get are regarding unknown
> functions being referenced, yet, I never get an error that the include
files
> can't be found.  It's all crazy to me.
>
>

Re: [PHP-DB] include() statement hell!

2002-03-28 Thread Brad Melendy

Thanks Jonathan,
Your suggestions were very helpful, especially turning on the error logging.
Here is where I'm at now:

Files in use:
/include/dblib.inc
/include/userlib.inc
/main/page.php

My include statements in /main/page.php:
include("../include/dblib.inc");
include("../include/userlib.inc");

All the fuctions I call from dblib.inc work great, however, I have only a
single function in userlib.inc and it generates an error.  The error I get
is:

Fatal error: Call to undefined function: cleansession()

Here is the file userlib.inc:



Lastly, if I paste the above function  into page.php (without the
session_start and session_register lines) it works fine.  I've tried giving
the function a different name, changing case, all sorts of stuff.  I've
tried renaming it to userlib.php and I've opened the file directly in my
browser with the error_reporting(2039); at the top and no error messages,
yet it is as if the file never gets included.  I've tried including ONLY
userlib.inc and pasting all the dblib.inc functions into page.php (to rule
out dblib.inc screwing things up) and still I get the error.

I am truly confounded at this point.  Thanks for any suggestions you have.
I think I am almost out of "Include Statement Hell".  ;-)

...Brad

"Jonathan Hilgeman" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > So, maybe this is the question.  Can you include a file from
> > /main/page.php by using a path of /includes/dblib.inc?
>
> Probably not. PHP can "see" the whole filesystem, not just the area that
is
> limited to your account. So, when you try to include "/includes/dblib.inc"
> it is trying to go down to the SYSTEM root and open up a subdirectory
called
> includes and get the file dblib.inc inside it.
>
> If you copy the dblib.inc to the same directory as page.php, you should
only
> have to say:
>  include("dblib.inc");
>
> However, if you have this layout:
>  /your/account/dir/main/page.php
>  /your/account/dir/includes/dblib.inc
>  /your/account/dir/includes/userlib.inc
>
> Then page.php would have to say:
>  include("../includes/dblib.inc");
>
> Which would go back one directory, THEN into the includes subdirectory,
and
> then it could find dblib.inc
>
> I would definitely add:
>  error_reporting(2039);
>
> ...to the top of your page.php code to see if you can pick up any errors.
> Also, check your error log if you have one (contact your hosting company
if
> you're not sure).
>
> I would definitely try to solve this the normal way by finding the problem
> with the paths rather than trying to screw with your php.ini or httpd.conf
> file - otherwise you'll have a script that might not work if you ever have
> to move your scripts or copy them to a development server or something.
>
> - Jonathan
>
> -Original Message-
> From: Brad Melendy [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, March 27, 2002 7:27 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP-DB] include() statement hell!
>
>
> Thanks Jonathan,
> I'm trying to include a file /includes/dblib.inc from /main/page.php.  In
> /main/page.php I use include("includes/dblib.inc");.  When that didn't
work,
> I tried copying the file to /main/ and including it there and that didn't
> work either.  Finally, I tried adding a specific path to the php.ini file
> for includes_path and put the files there and that worked.  Then I went
and
> changed the php.ini file to remove the reference (still trying to get it
to
> work the way I THINK it should) and then it WORKED!  But ONLY from within
> /main/.  Each time I make these changes, I am making a matching change in
> the actual include() statement at the top of /main/page.php and I am
> restarting apache each time I change php.ini.
>
> So, maybe this is the question.  Can you include a file from
/main/page.php
> by using a path of /includes/dblib.inc?
>
> dblib.inc has functions that do connections and queries to a mysql
database.
> Even stranger yet, is that I have one other include file called
userlib.inc
> that has authentication related session functions.  Well, that hasn't
worked
> at all no matter what, unless I put the functions in /includes/userlib.inc
> directly into the file /main/page.php.  Once there, all the functions work
> fine.  Otherwise, the only error messages I get are regarding unknown
> functions being referenced, yet, I never get an error that the include
files
> can't be found.  It's all crazy to me.
>
> Currently, both of my include files are called directly with two lines
like:
>
> include("dblib.inc");
> include("userlib.inc");
>
>

RE: [PHP-DB] include() statement hell!

2002-03-28 Thread JD Daniels


I have found the best way for me is always include with the fullpath ie,

include("/usr/httpd/mysite/include.inc");

or:

include($_SERVER['DOCUMENT_ROOT']"/include.inc");

Then you can include files that are elswhere:

include("/usr/httpd/virtual-domain-includes/multi-user-include.inc");

these will work no matter what dir or sub dir the page calling the include
is in...

(I haven't Followed This entire thread.. so sorry if I missed something)

JD

-Original Message-
From: Jonathan Hilgeman [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 28, 2002 10:10 AM
To: 'Brad Melendy'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] include() statement hell!


> So, maybe this is the question.  Can you include a file from
> /main/page.php by using a path of /includes/dblib.inc?

Probably not. PHP can "see" the whole filesystem, not just the area that is
limited to your account. So, when you try to include "/includes/dblib.inc"
it is trying to go down to the SYSTEM root and open up a subdirectory called
includes and get the file dblib.inc inside it.

If you copy the dblib.inc to the same directory as page.php, you should only
have to say:
 include("dblib.inc");

However, if you have this layout:
 /your/account/dir/main/page.php
 /your/account/dir/includes/dblib.inc
 /your/account/dir/includes/userlib.inc

Then page.php would have to say:
 include("../includes/dblib.inc");

Which would go back one directory, THEN into the includes subdirectory, and
then it could find dblib.inc

I would definitely add:
 error_reporting(2039);

...to the top of your page.php code to see if you can pick up any errors.
Also, check your error log if you have one (contact your hosting company if
you're not sure).

I would definitely try to solve this the normal way by finding the problem
with the paths rather than trying to screw with your php.ini or httpd.conf
file - otherwise you'll have a script that might not work if you ever have
to move your scripts or copy them to a development server or something.

- Jonathan

-Original Message-
From: Brad Melendy [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 27, 2002 7:27 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] include() statement hell!


Thanks Jonathan,
I'm trying to include a file /includes/dblib.inc from /main/page.php.  In
/main/page.php I use include("includes/dblib.inc");.  When that didn't work,
I tried copying the file to /main/ and including it there and that didn't
work either.  Finally, I tried adding a specific path to the php.ini file
for includes_path and put the files there and that worked.  Then I went and
changed the php.ini file to remove the reference (still trying to get it to
work the way I THINK it should) and then it WORKED!  But ONLY from within
/main/.  Each time I make these changes, I am making a matching change in
the actual include() statement at the top of /main/page.php and I am
restarting apache each time I change php.ini.

So, maybe this is the question.  Can you include a file from /main/page.php
by using a path of /includes/dblib.inc?

dblib.inc has functions that do connections and queries to a mysql database.
Even stranger yet, is that I have one other include file called userlib.inc
that has authentication related session functions.  Well, that hasn't worked
at all no matter what, unless I put the functions in /includes/userlib.inc
directly into the file /main/page.php.  Once there, all the functions work
fine.  Otherwise, the only error messages I get are regarding unknown
functions being referenced, yet, I never get an error that the include files
can't be found.  It's all crazy to me.

Currently, both of my include files are called directly with two lines like:

include("dblib.inc");
include("userlib.inc");

They are both located in /main/ along side page.php which is calling them.
They both seem to work this way, but as soon as I place them in /includes/
and try to call them using:

include("includes/dblib.inc");
include("includes/userlib.inc");

I get errors saying that the functions can't be found, however, no errors
saying it can't find the include files??

Lastly, even with both include files in /main/ I still have some strange
problem with my userlib.inc file because the single function that is in
there won't work unless the function is pasted directly into /main/page.php.

I think I've made this message way too long but I appreciate your help.
I've got the page working reliably with the functions all pasted into
page.php but not while including those functions.  I just can't think of
what could be making it difference.  The functions are all the same, just
running from an include file is a problem.

Thanks again, just writing this up has helped to make more sense to me.  I
think the crux of the whole thing

RE: [PHP-DB] include() statement hell!

2002-03-28 Thread Jonathan Hilgeman

> So, maybe this is the question.  Can you include a file from
> /main/page.php by using a path of /includes/dblib.inc?

Probably not. PHP can "see" the whole filesystem, not just the area that is
limited to your account. So, when you try to include "/includes/dblib.inc"
it is trying to go down to the SYSTEM root and open up a subdirectory called
includes and get the file dblib.inc inside it.

If you copy the dblib.inc to the same directory as page.php, you should only
have to say:
 include("dblib.inc");

However, if you have this layout:
 /your/account/dir/main/page.php
 /your/account/dir/includes/dblib.inc
 /your/account/dir/includes/userlib.inc

Then page.php would have to say:
 include("../includes/dblib.inc");

Which would go back one directory, THEN into the includes subdirectory, and
then it could find dblib.inc

I would definitely add:
 error_reporting(2039);

...to the top of your page.php code to see if you can pick up any errors.
Also, check your error log if you have one (contact your hosting company if
you're not sure). 

I would definitely try to solve this the normal way by finding the problem
with the paths rather than trying to screw with your php.ini or httpd.conf
file - otherwise you'll have a script that might not work if you ever have
to move your scripts or copy them to a development server or something.

- Jonathan

-Original Message-
From: Brad Melendy [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 27, 2002 7:27 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] include() statement hell!


Thanks Jonathan,
I'm trying to include a file /includes/dblib.inc from /main/page.php.  In
/main/page.php I use include("includes/dblib.inc");.  When that didn't work,
I tried copying the file to /main/ and including it there and that didn't
work either.  Finally, I tried adding a specific path to the php.ini file
for includes_path and put the files there and that worked.  Then I went and
changed the php.ini file to remove the reference (still trying to get it to
work the way I THINK it should) and then it WORKED!  But ONLY from within
/main/.  Each time I make these changes, I am making a matching change in
the actual include() statement at the top of /main/page.php and I am
restarting apache each time I change php.ini.

So, maybe this is the question.  Can you include a file from /main/page.php
by using a path of /includes/dblib.inc?

dblib.inc has functions that do connections and queries to a mysql database.
Even stranger yet, is that I have one other include file called userlib.inc
that has authentication related session functions.  Well, that hasn't worked
at all no matter what, unless I put the functions in /includes/userlib.inc
directly into the file /main/page.php.  Once there, all the functions work
fine.  Otherwise, the only error messages I get are regarding unknown
functions being referenced, yet, I never get an error that the include files
can't be found.  It's all crazy to me.

Currently, both of my include files are called directly with two lines like:

include("dblib.inc");
include("userlib.inc");

They are both located in /main/ along side page.php which is calling them.
They both seem to work this way, but as soon as I place them in /includes/
and try to call them using:

include("includes/dblib.inc");
include("includes/userlib.inc");

I get errors saying that the functions can't be found, however, no errors
saying it can't find the include files??

Lastly, even with both include files in /main/ I still have some strange
problem with my userlib.inc file because the single function that is in
there won't work unless the function is pasted directly into /main/page.php.

I think I've made this message way too long but I appreciate your help.
I've got the page working reliably with the functions all pasted into
page.php but not while including those functions.  I just can't think of
what could be making it difference.  The functions are all the same, just
running from an include file is a problem.

Thanks again, just writing this up has helped to make more sense to me.  I
think the crux of the whole thing is the path.  I'm using to including files
in ASP and those can be relative so something like ../includes/dblib.inc
works great.

...Brad




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




Re: [PHP-DB] include() statement hell!

2002-03-27 Thread Jason Wong

On Thursday 28 March 2002 14:58, Brad Melendy wrote:
> How is this different than using the php.ini file?
>
> "Photocon" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> > At 22:41 3/27/2002 -0600, Dan Brunner wrote:
> > >Has anybody told him to check his PHP.INI???
> >
> > How about adding the following to httpd.conf:
> >
> > php_value include_path .:/usr/share/php:/path/to/webpages

Because you can have per-site settings which are different from those of 
php.ini.


Also you can have per-file settings by using the ini_set() function. If 
you're not able to change the httpd.conf file then just use ini_set() at the 
beginning of all your php files to specify an include path.


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
Support wildlife -- vote for an orgy.
*/

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




Re: [PHP-DB] include() statement hell!

2002-03-27 Thread Brad Melendy

How is this different than using the php.ini file?

"Photocon" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> At 22:41 3/27/2002 -0600, Dan Brunner wrote:
> >Has anybody told him to check his PHP.INI???
>
> How about adding the following to httpd.conf:
>
> php_value include_path .:/usr/share/php:/path/to/webpages
>
>
> --Photocon
> Conrad Hunziker III
> www.nightskyent.com
>



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




Re: [PHP-DB] include() statement hell!

2002-03-27 Thread Brad Melendy

The thing that sucks about having to rely upon the php.ini file is that the
you must use a particular folder for all your include files, even if you are
using files for several different sites.  It makes much more sense to be
able to put your include files for a particular site in that site.  It's
easier for backups, moving the site and for shared hosting.  I've gotten it
to work partially using the folder defined in the php.ini file, but I want
to be able to specifiy a folder from within the calling php file, which is
how you should be able to do it.

...Brad


"Dan Brunner" <[EMAIL PROTECTED]> wrote in message
01c1d612$e94f0570$b3f7a718@doggy">news:01c1d612$e94f0570$b3f7a718@doggy...
> Has anybody told him to check his PHP.INI???
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, March 27, 2002 6:28 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: RE: [PHP-DB] include() statement hell!
>
> #1. You may want to double-check the path where you're calling it from
> in
> case you're working with subdirectories.
>
> Let's saying you access a page at www.domain.com/page.php which calls
> www.domain.com/includes/header.inc.
> Then, header.inc includes the dblib.inc file at
> www.domain.com/includes/dblib.inc. However, the include's base directory
> will still be in page.php - the directory won't change to includes, so
> for
> header.inc to include dblib.inc, it has to say:
>   include("includes/dblib.inc");
> NOT
>   include("dblib.inc");
> Otherwise, it will be trying to include www.domain.com/dblib.inc because
> the
> page that started the whole chain reaction of includes is located at
> www.domain.com/page.php
>
> #2. If you have error reporting turned off, and there is a parsing error
> in
> your files, the page may just die without giving a reason. Try turning
> off
> any error reporting and also access those include files like userlib.inc
> directly in your web browser to see if PHP reports any errors. You may
> need
> to change the extension to something like userlib.inc.php for the web
> server
> to recognize the request correctly.
>
> #3. Please give us a little more detail on the errors you're getting
> (any
> specific messages would be nice).
>
> - Jonathan
>
> -Original Message-
> From: Rick Emery [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, March 27, 2002 3:42 PM
> To: 'Brad Melendy'; [EMAIL PROTECTED]
> Subject: RE: [PHP-DB] include() statement hell!
>
>
> did you start each include file with:
>  ?>
>
> If not, PHP treats the code within as straight text
>
> -Original Message-
> From: Brad Melendy [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, March 27, 2002 5:03 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] include() statement hell!
>
>
> Ok, I've spent some time reading the docs at php.net and I'm still
> confused.
>
> After a couple hours, I have an include file working with a statement
> like:
>
> include ("dblib.inc");
>
> However, to add to my confusion, I've got a second include file
> statement on
> the next line:
>
> include ("userlib.inc");
>
> And that doesn't work.
>
> Most crazy of all, if I just put the darn functions all in the PHP file
> that
> is trying to call the include files, everything works perfectly.
>
> So far I have my include_path line in the pho.ini file set to no value
> since
> I'm just using include files that exist in the same directory as the
> calling
> php file.  this after I could NOT get the files to be properly
> recognized
> from their own include directory.  As far as I'm concerned, you should
> be
> able to include a relative path with the included filename and have it
> work.
> Too bad that doesn't work in PHP.
>
> So, long story short, I'm about to give up on include statements and
> just
> copy and paste my functions all over the place.  Does anyone have any
> ideas
> why this is so difficult for me?  What am I missing?  This stuff is easy
> in
> ASP but PHP is giving me serious heart-ache.  :-(
>
> Thanks for any tips or suggestions.
>
> Brad
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



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




RE: [PHP-DB] include() statement hell!

2002-03-27 Thread Photocon

At 22:41 3/27/2002 -0600, Dan Brunner wrote:
>Has anybody told him to check his PHP.INI???

How about adding the following to httpd.conf:

php_value include_path .:/usr/share/php:/path/to/webpages


--Photocon
Conrad Hunziker III
www.nightskyent.com


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




RE: [PHP-DB] include() statement hell!

2002-03-27 Thread Dan Brunner

Has anybody told him to check his PHP.INI???

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, March 27, 2002 6:28 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] include() statement hell!

#1. You may want to double-check the path where you're calling it from
in
case you're working with subdirectories. 

Let's saying you access a page at www.domain.com/page.php which calls
www.domain.com/includes/header.inc.
Then, header.inc includes the dblib.inc file at
www.domain.com/includes/dblib.inc. However, the include's base directory
will still be in page.php - the directory won't change to includes, so
for
header.inc to include dblib.inc, it has to say:
  include("includes/dblib.inc");
NOT
  include("dblib.inc");
Otherwise, it will be trying to include www.domain.com/dblib.inc because
the
page that started the whole chain reaction of includes is located at
www.domain.com/page.php

#2. If you have error reporting turned off, and there is a parsing error
in
your files, the page may just die without giving a reason. Try turning
off
any error reporting and also access those include files like userlib.inc
directly in your web browser to see if PHP reports any errors. You may
need
to change the extension to something like userlib.inc.php for the web
server
to recognize the request correctly. 

#3. Please give us a little more detail on the errors you're getting
(any
specific messages would be nice).

- Jonathan

-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 27, 2002 3:42 PM
To: 'Brad Melendy'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] include() statement hell!


did you start each include file with:


If not, PHP treats the code within as straight text

-Original Message-
From: Brad Melendy [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 27, 2002 5:03 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] include() statement hell!


Ok, I've spent some time reading the docs at php.net and I'm still
confused.

After a couple hours, I have an include file working with a statement
like:

include ("dblib.inc");

However, to add to my confusion, I've got a second include file
statement on
the next line:

include ("userlib.inc");

And that doesn't work.

Most crazy of all, if I just put the darn functions all in the PHP file
that
is trying to call the include files, everything works perfectly.

So far I have my include_path line in the pho.ini file set to no value
since
I'm just using include files that exist in the same directory as the
calling
php file.  this after I could NOT get the files to be properly
recognized
from their own include directory.  As far as I'm concerned, you should
be
able to include a relative path with the included filename and have it
work.
Too bad that doesn't work in PHP.

So, long story short, I'm about to give up on include statements and
just
copy and paste my functions all over the place.  Does anyone have any
ideas
why this is so difficult for me?  What am I missing?  This stuff is easy
in
ASP but PHP is giving me serious heart-ache.  :-(

Thanks for any tips or suggestions.

Brad



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

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

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



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




Re: [PHP-DB] include() statement hell!

2002-03-27 Thread Brad Melendy

Thanks Jonathan,
I'm trying to include a file /includes/dblib.inc from /main/page.php.  In
/main/page.php I use include("includes/dblib.inc");.  When that didn't work,
I tried copying the file to /main/ and including it there and that didn't
work either.  Finally, I tried adding a specific path to the php.ini file
for includes_path and put the files there and that worked.  Then I went and
changed the php.ini file to remove the reference (still trying to get it to
work the way I THINK it should) and then it WORKED!  But ONLY from within
/main/.  Each time I make these changes, I am making a matching change in
the actual include() statement at the top of /main/page.php and I am
restarting apache each time I change php.ini.

So, maybe this is the question.  Can you include a file from /main/page.php
by using a path of /includes/dblib.inc?

dblib.inc has functions that do connections and queries to a mysql database.
Even stranger yet, is that I have one other include file called userlib.inc
that has authentication related session functions.  Well, that hasn't worked
at all no matter what, unless I put the functions in /includes/userlib.inc
directly into the file /main/page.php.  Once there, all the functions work
fine.  Otherwise, the only error messages I get are regarding unknown
functions being referenced, yet, I never get an error that the include files
can't be found.  It's all crazy to me.

Currently, both of my include files are called directly with two lines like:

include("dblib.inc");
include("userlib.inc");

They are both located in /main/ along side page.php which is calling them.
They both seem to work this way, but as soon as I place them in /includes/
and try to call them using:

include("includes/dblib.inc");
include("includes/userlib.inc");

I get errors saying that the functions can't be found, however, no errors
saying it can't find the include files??

Lastly, even with both include files in /main/ I still have some strange
problem with my userlib.inc file because the single function that is in
there won't work unless the function is pasted directly into /main/page.php.

I think I've made this message way too long but I appreciate your help.
I've got the page working reliably with the functions all pasted into
page.php but not while including those functions.  I just can't think of
what could be making it difference.  The functions are all the same, just
running from an include file is a problem.

Thanks again, just writing this up has helped to make more sense to me.  I
think the crux of the whole thing is the path.  I'm using to including files
in ASP and those can be relative so something like ../includes/dblib.inc
works great.

...Brad



"Jonathan Hilgeman" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> #1. You may want to double-check the path where you're calling it from in
> case you're working with subdirectories.
>
> Let's saying you access a page at www.domain.com/page.php which calls
> www.domain.com/includes/header.inc.
> Then, header.inc includes the dblib.inc file at
> www.domain.com/includes/dblib.inc. However, the include's base directory
> will still be in page.php - the directory won't change to includes, so for
> header.inc to include dblib.inc, it has to say:
>   include("includes/dblib.inc");
> NOT
>   include("dblib.inc");
> Otherwise, it will be trying to include www.domain.com/dblib.inc because
the
> page that started the whole chain reaction of includes is located at
> www.domain.com/page.php
>
> #2. If you have error reporting turned off, and there is a parsing error
in
> your files, the page may just die without giving a reason. Try turning off
> any error reporting and also access those include files like userlib.inc
> directly in your web browser to see if PHP reports any errors. You may
need
> to change the extension to something like userlib.inc.php for the web
server
> to recognize the request correctly.
>
> #3. Please give us a little more detail on the errors you're getting (any
> specific messages would be nice).
>
> - Jonathan
>
> -Original Message-
> From: Rick Emery [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, March 27, 2002 3:42 PM
> To: 'Brad Melendy'; [EMAIL PROTECTED]
> Subject: RE: [PHP-DB] include() statement hell!
>
>
> did you start each include file with:
>  ?>
>
> If not, PHP treats the code within as straight text
>
> -Original Message-
> From: Brad Melendy [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, March 27, 2002 5:03 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] include() statement hell!
>
>
> Ok, I've spent some time reading the docs 

Re: [PHP-DB] include() statement hell!

2002-03-27 Thread Brad Melendy

Hi Rick,
Yes, this is the first thing I checked.  Thanks for your suggestion.

...Brad

"Rick Emery" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> did you start each include file with:
>  ?>
>
> If not, PHP treats the code within as straight text
>
> -Original Message-
> From: Brad Melendy [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, March 27, 2002 5:03 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] include() statement hell!
>
>
> Ok, I've spent some time reading the docs at php.net and I'm still
confused.
>
> After a couple hours, I have an include file working with a statement
like:
>
> include ("dblib.inc");
>
> However, to add to my confusion, I've got a second include file statement
on
> the next line:
>
> include ("userlib.inc");
>
> And that doesn't work.
>
> Most crazy of all, if I just put the darn functions all in the PHP file
that
> is trying to call the include files, everything works perfectly.
>
> So far I have my include_path line in the pho.ini file set to no value
since
> I'm just using include files that exist in the same directory as the
calling
> php file.  this after I could NOT get the files to be properly recognized
> from their own include directory.  As far as I'm concerned, you should be
> able to include a relative path with the included filename and have it
work.
> Too bad that doesn't work in PHP.
>
> So, long story short, I'm about to give up on include statements and just
> copy and paste my functions all over the place.  Does anyone have any
ideas
> why this is so difficult for me?  What am I missing?  This stuff is easy
in
> ASP but PHP is giving me serious heart-ache.  :-(
>
> Thanks for any tips or suggestions.
>
> Brad
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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




RE: [PHP-DB] include() statement hell!

2002-03-27 Thread Jonathan Hilgeman

#1. You may want to double-check the path where you're calling it from in
case you're working with subdirectories. 

Let's saying you access a page at www.domain.com/page.php which calls
www.domain.com/includes/header.inc.
Then, header.inc includes the dblib.inc file at
www.domain.com/includes/dblib.inc. However, the include's base directory
will still be in page.php - the directory won't change to includes, so for
header.inc to include dblib.inc, it has to say:
  include("includes/dblib.inc");
NOT
  include("dblib.inc");
Otherwise, it will be trying to include www.domain.com/dblib.inc because the
page that started the whole chain reaction of includes is located at
www.domain.com/page.php

#2. If you have error reporting turned off, and there is a parsing error in
your files, the page may just die without giving a reason. Try turning off
any error reporting and also access those include files like userlib.inc
directly in your web browser to see if PHP reports any errors. You may need
to change the extension to something like userlib.inc.php for the web server
to recognize the request correctly. 

#3. Please give us a little more detail on the errors you're getting (any
specific messages would be nice).

- Jonathan

-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 27, 2002 3:42 PM
To: 'Brad Melendy'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] include() statement hell!


did you start each include file with:


If not, PHP treats the code within as straight text

-Original Message-
From: Brad Melendy [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 27, 2002 5:03 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] include() statement hell!


Ok, I've spent some time reading the docs at php.net and I'm still confused.

After a couple hours, I have an include file working with a statement like:

include ("dblib.inc");

However, to add to my confusion, I've got a second include file statement on
the next line:

include ("userlib.inc");

And that doesn't work.

Most crazy of all, if I just put the darn functions all in the PHP file that
is trying to call the include files, everything works perfectly.

So far I have my include_path line in the pho.ini file set to no value since
I'm just using include files that exist in the same directory as the calling
php file.  this after I could NOT get the files to be properly recognized
from their own include directory.  As far as I'm concerned, you should be
able to include a relative path with the included filename and have it work.
Too bad that doesn't work in PHP.

So, long story short, I'm about to give up on include statements and just
copy and paste my functions all over the place.  Does anyone have any ideas
why this is so difficult for me?  What am I missing?  This stuff is easy in
ASP but PHP is giving me serious heart-ache.  :-(

Thanks for any tips or suggestions.

Brad



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

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

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




RE: [PHP-DB] include() statement hell!

2002-03-27 Thread Rick Emery

did you start each include file with:


If not, PHP treats the code within as straight text

-Original Message-
From: Brad Melendy [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 27, 2002 5:03 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] include() statement hell!


Ok, I've spent some time reading the docs at php.net and I'm still confused.

After a couple hours, I have an include file working with a statement like:

include ("dblib.inc");

However, to add to my confusion, I've got a second include file statement on
the next line:

include ("userlib.inc");

And that doesn't work.

Most crazy of all, if I just put the darn functions all in the PHP file that
is trying to call the include files, everything works perfectly.

So far I have my include_path line in the pho.ini file set to no value since
I'm just using include files that exist in the same directory as the calling
php file.  this after I could NOT get the files to be properly recognized
from their own include directory.  As far as I'm concerned, you should be
able to include a relative path with the included filename and have it work.
Too bad that doesn't work in PHP.

So, long story short, I'm about to give up on include statements and just
copy and paste my functions all over the place.  Does anyone have any ideas
why this is so difficult for me?  What am I missing?  This stuff is easy in
ASP but PHP is giving me serious heart-ache.  :-(

Thanks for any tips or suggestions.

Brad



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

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




[PHP-DB] include files don't work???

2002-03-27 Thread Brad Melendy

Hi All,
This is strange.  I've got some functions I want to include in my PHP
documents.  Well, I can never get anything to work if I include the file
that holds the functions, but, if I insert the functions into the PHP
document in question, everything works??

Now, I've checked to ensure that the path in the include statement is
correct and I never get any errors about it not being able to find the
include file.  Also, I've ensured that the functions in the included
document are enclosed with  tags at the top and bottom.

So, I'm looking for other possible gotchas or bugs in the include
statement??  Thanks in advance for any help.  I don't know what I could be
doing wrong.

Brad





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




[PHP-DB] include() statement hell!

2002-03-27 Thread Brad Melendy

Ok, I've spent some time reading the docs at php.net and I'm still confused.

After a couple hours, I have an include file working with a statement like:

include ("dblib.inc");

However, to add to my confusion, I've got a second include file statement on
the next line:

include ("userlib.inc");

And that doesn't work.

Most crazy of all, if I just put the darn functions all in the PHP file that
is trying to call the include files, everything works perfectly.

So far I have my include_path line in the pho.ini file set to no value since
I'm just using include files that exist in the same directory as the calling
php file.  this after I could NOT get the files to be properly recognized
from their own include directory.  As far as I'm concerned, you should be
able to include a relative path with the included filename and have it work.
Too bad that doesn't work in PHP.

So, long story short, I'm about to give up on include statements and just
copy and paste my functions all over the place.  Does anyone have any ideas
why this is so difficult for me?  What am I missing?  This stuff is easy in
ASP but PHP is giving me serious heart-ache.  :-(

Thanks for any tips or suggestions.

Brad



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




[PHP-DB] include shell scripts

2001-11-03 Thread sharmad

I m making a web based config tool in which i require to configure a package
via browser but whats happening in that if i give the command in system() call
then the packege is being tried to install as nobody user (default apache user)
.Pls give me the link about how to go about it (other than CGI) or any other
information 

-- 
PHP Database 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-DB] Include

2001-08-19 Thread CrossWalkCentral

Thank you I got it working good deal

--
Cross Walk Central
www.crosswalkcentral.net
Support Center
Your Web Hosting Community!

"Tom Carter" <[EMAIL PROTECTED]> wrote in message
001201c12888$bb8a9790$0a00a8c0@bjorn">news:001201c12888$bb8a9790$0a00a8c0@bjorn...
>Yes that is correct. On a security point of view therer is something
> extra you can do.. when using require you can require files that are
outside
> the web tree...by this I mean are not accessible thru the internet. So if
> you site was in /home/web then you could setup a directory, say
> /home/web_vars and in this put these kind of files.
>
> In the require statement you just then simple put in the full path, eg
> require("/home/web_vars/vars.php");
>
> The advantage of doing this is security When the file with such sensitive
> information is included in the web tree then there are (admittedly
limited)
> possible scenarios in which this could be compramised. It is generally
> accepted that it is sensible to avoid putting such information in the web
> tree.
>
> Hope I've been clear, let me know if you need any more advice.
>
> > so in var.php i will put something like this
> >
> > $db="mydatabse";
> > $username="myusername";
> > $password="mypassword";
> >
> >
> > and so on?
> >
> >
> > --
> > Cross Walk Central
> > www.crosswalkcentral.net
> > Support Center
> > Your Web Hosting Community!
> >
> > "Seb Frost" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > chuck all the common variables in var.php
> > >
> > > then just put
> > >
> > >  > > require("var.php");
> > > ?>
> > >
> > > - seb
> > >
> > > -Original Message-
> > > From: CrossWalkCentral [mailto:[EMAIL PROTECTED]]
> > > Sent: 19 August 2001 03:18
> > > To: [EMAIL PROTECTED]
> > > Subject: [PHP-DB] Include
> > >
> > >
> > > OK here is one for you folks that know what you are doing.
> > >
> > > I am making a script and I have about 5 php files in it. That have
alot
> of
> > > the same system variables can I create one file with these settings in
> it
> > > and if so any one want to give me some hints on this
> > >
> > > thanks again.
> > >
> > > --
> > > Cross Walk Central
> > > www.crosswalkcentral.net
> > > Support Center
> > > Your Web Hosting Community!
> > >
> > >
> > >
> > >
> > > --
> > > PHP Database 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 Database 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 Database 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-DB] Include

2001-08-19 Thread Tom Carter

   Yes that is correct. On a security point of view therer is something
extra you can do.. when using require you can require files that are outside
the web tree...by this I mean are not accessible thru the internet. So if
you site was in /home/web then you could setup a directory, say
/home/web_vars and in this put these kind of files.

In the require statement you just then simple put in the full path, eg
require("/home/web_vars/vars.php");

The advantage of doing this is security When the file with such sensitive
information is included in the web tree then there are (admittedly limited)
possible scenarios in which this could be compramised. It is generally
accepted that it is sensible to avoid putting such information in the web
tree.

Hope I've been clear, let me know if you need any more advice.

> so in var.php i will put something like this
>
> $db="mydatabse";
> $username="myusername";
> $password="mypassword";
>
>
> and so on?
>
>
> --
> Cross Walk Central
> www.crosswalkcentral.net
> Support Center
> Your Web Hosting Community!
>
> "Seb Frost" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > chuck all the common variables in var.php
> >
> > then just put
> >
> >  > require("var.php");
> > ?>
> >
> > - seb
> >
> > -Original Message-
> > From: CrossWalkCentral [mailto:[EMAIL PROTECTED]]
> > Sent: 19 August 2001 03:18
> > To: [EMAIL PROTECTED]
> > Subject: [PHP-DB] Include
> >
> >
> > OK here is one for you folks that know what you are doing.
> >
> > I am making a script and I have about 5 php files in it. That have alot
of
> > the same system variables can I create one file with these settings in
it
> > and if so any one want to give me some hints on this
> >
> > thanks again.
> >
> > --
> > Cross Walk Central
> > www.crosswalkcentral.net
> > Support Center
> > Your Web Hosting Community!
> >
> >
> >
> >
> > --
> > PHP Database 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 Database 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 Database 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-DB] Include

2001-08-18 Thread CrossWalkCentral

so in var.php i will put something like this

$db="mydatabse";
$username="myusername";
$password="mypassword";


and so on?


--
Cross Walk Central
www.crosswalkcentral.net
Support Center
Your Web Hosting Community!

"Seb Frost" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> chuck all the common variables in var.php
>
> then just put
>
>  require("var.php");
> ?>
>
> - seb
>
> -Original Message-
> From: CrossWalkCentral [mailto:[EMAIL PROTECTED]]
> Sent: 19 August 2001 03:18
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Include
>
>
> OK here is one for you folks that know what you are doing.
>
> I am making a script and I have about 5 php files in it. That have alot of
> the same system variables can I create one file with these settings in it
> and if so any one want to give me some hints on this
>
> thanks again.
>
> --
> Cross Walk Central
> www.crosswalkcentral.net
> Support Center
> Your Web Hosting Community!
>
>
>
>
> --
> PHP Database 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 Database 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-DB] Include

2001-08-18 Thread Seb Frost

chuck all the common variables in var.php

then just put 



- seb

-Original Message-
From: CrossWalkCentral [mailto:[EMAIL PROTECTED]]
Sent: 19 August 2001 03:18
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Include


OK here is one for you folks that know what you are doing.

I am making a script and I have about 5 php files in it. That have alot of
the same system variables can I create one file with these settings in it
and if so any one want to give me some hints on this

thanks again.

--
Cross Walk Central
www.crosswalkcentral.net
Support Center
Your Web Hosting Community!




-- 
PHP Database 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 Database 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-DB] Include

2001-08-18 Thread CrossWalkCentral

OK here is one for you folks that know what you are doing.

I am making a script and I have about 5 php files in it. That have alot of
the same system variables can I create one file with these settings in it
and if so any one want to give me some hints on this

thanks again.

--
Cross Walk Central
www.crosswalkcentral.net
Support Center
Your Web Hosting Community!




-- 
PHP Database 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-DB] Include File Syntax

2001-04-27 Thread Kelvin

Hi,

This is a small example to connect the Database.


and save as "dedb.inc"
And Then, in your php. file  Before you start any statement or query. put
this on first.


OK...

Kelvin.


""James McLaughlin"" <[EMAIL PROTECTED]> wrote in message
000801c0ce20$9ab1e900$[EMAIL PROTECTED]">news:000801c0ce20$9ab1e900$[EMAIL PROTECTED]...
> This is my first time programming with PHP.  I have seen include files in
> the beginning of a php block and wonder is there a specific syntax used in
> these files and how secure this is vs code in my .php page?
>
> Can someone show me a small example of what the include file might look
like
> that would contain variables for  $mysql server, $username $password and
> $db_name.
>
> Any comments you may have about security involving files containing these
> variables and where to store them would be greatly appreciated.
>
>
>
> Thanks In Advance.
>
>
> Kat
>
>
> --
> PHP Database 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 Database 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-DB] Include File Syntax

2001-04-26 Thread Vlad

Hi
Format of included files is the same as original .php file.:)
When you include .php file it is the same as you copy that file in your main
.php file in that place.

> This is my first time programming with PHP.  I have seen include files in
> the beginning of a php block and wonder is there a specific syntax used in
> these files and how secure this is vs code in my .php page?
>
> Can someone show me a small example of what the include file might look
like
> that would contain variables for  $mysql server, $username $password and
> $db_name.
>
> Any comments you may have about security involving files containing these
> variables and where to store them would be greatly appreciated.
>
>
>
> Thanks In Advance.
>
>
> Kat
>
>
> --
> PHP Database 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 Database 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-DB] Include File Syntax

2001-04-26 Thread Steve Brett

hi kat,

the include files are simply a way for repetitive code (like a connection to
a db) to be inserted into your pages.

the syntax for the files is the same as any php script and it is added to
the page at the point that you include it.

the format is 

include ("page_name.php");

the pages that are included are as secure as your scripts.

Steve

> -Original Message-
> From: James McLaughlin [mailto:[EMAIL PROTECTED]]
> Sent: 26 April 2001 08:15
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Include File Syntax
> 
> 
> This is my first time programming with PHP.  I have seen 
> include files in
> the beginning of a php block and wonder is there a specific 
> syntax used in
> these files and how secure this is vs code in my .php page?
> 
> Can someone show me a small example of what the include file 
> might look like
> that would contain variables for  $mysql server, $username 
> $password and
> $db_name.
> 
> Any comments you may have about security involving files 
> containing these
> variables and where to store them would be greatly appreciated.
> 
> 
> 
> Thanks In Advance.
> 
> 
> Kat
> 
> 
> -- 
> PHP Database 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 Database 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-DB] Include File Syntax

2001-04-26 Thread James McLaughlin

This is my first time programming with PHP.  I have seen include files in
the beginning of a php block and wonder is there a specific syntax used in
these files and how secure this is vs code in my .php page?

Can someone show me a small example of what the include file might look like
that would contain variables for  $mysql server, $username $password and
$db_name.

Any comments you may have about security involving files containing these
variables and where to store them would be greatly appreciated.



Thanks In Advance.


Kat


-- 
PHP Database 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-DB] Include problem.

2001-01-23 Thread JJeffman

I am running PHP3.017(cgi) + Apache + MySQL on Windows98 SE.
The include() and the getenv() functions are asking for a dial-up
connection. Can somebody give me a hand ?

Jayme.

http://www.conex.com.br/jjeffman






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