Re: [PHP] Problem with Include
On Tue, Dec 21, 2010 at 2:48 AM, Ravi Gehlot r...@ravigehlot.net wrote: My point is that you tried to Not me personally. take code from one page and put it all organized in another page and the include that page of includes back into the pages that you want it to feed off from. If stuff works the way that it does then there a reason for it to have been done that way. By the original designer, but maybe not the OP. That's why documenting code is so important. 99% doesn't do it (including me). For you, others, and for self, it's more than important, it can be essential, especially if you're trying to keep up with multiple languages, OS's, and platforms. Ravi. On Tue, Dec 21, 2010 at 2:35 AM, David Hutto smokefl...@gmail.com wrote: On Tue, Dec 21, 2010 at 2:29 AM, Ravi Gehlot r...@ravigehlot.net wrote: Why mess with something that is already working? If you are trying to make it pretty then you are not solving a problem. You are creating one. Define working. I've had programs 'work', but more experienced would say it's flawed in some respect. Does it perform the immediate task? Now define pretty. Is it aesthetically pleasing to you, or to someone else with less, or maybe more experience. By defining the two above, you then define whether it's a problem. To you, or to them, or to the original designer? Ravi. On Mon, Dec 20, 2010 at 7:40 AM, Daniel P. Brown daniel.br...@parasane.netwrote: On Mon, Dec 20, 2010 at 02:49, Simcha Younger sim...@syounger.com wrote: Since it is being included by PHP, and not served by Apache, the extension is not important. Correct, but keep in mind that it will likely be served as plain text if accessed directly, if the web server is not properly configured (which, by default, it isn't). -- /Daniel P. Brown Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting (866-) 725-4321 http://www.parasane.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- They're installing the breathalyzer on my email account next week. -- They're installing the breathalyzer on my email account next week. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Include
On Tue, Dec 21, 2010 at 02:48, Ravi Gehlot r...@ravigehlot.net wrote: My point is that you tried to take code from one page and put it all organized in another page and the include that page of includes back into the pages that you want it to feed off from. If stuff works the way that it does then there a reason for it to have been done that way. So you think no one should ever do that because it's only making it look pretty? Ever hear of maintainability? That's why documenting code is so important. 99% doesn't do it (including me). Please cite your source. -- /Daniel P. Brown Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting (866-) 725-4321 http://www.parasane.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Include
On Tue, Dec 21, 2010 at 9:50 AM, Daniel P. Brown daniel.br...@parasane.net wrote: On Tue, Dec 21, 2010 at 02:48, Ravi Gehlot r...@ravigehlot.net wrote: My point is that you tried to take code from one page and put it all organized in another page and the include that page of includes back into the pages that you want it to feed off from. If stuff works the way that it does then there a reason for it to have been done that way. So you think no one should ever do that because it's only making it look pretty? Ever hear of maintainability? That's why documenting code is so important. 99% doesn't do it (including me). Please cite your source. Personally, I'd even have to admit mine was less than 99% compatible with what I'd like it to be. -- /Daniel P. Brown Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting (866-) 725-4321 http://www.parasane.net/ -- They're installing the breathalyzer on my email account next week. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Include
On Tue, Dec 21, 2010 at 9:54 AM, David Hutto smokefl...@gmail.com wrote: On Tue, Dec 21, 2010 at 9:50 AM, Daniel P. Brown daniel.br...@parasane.net wrote: On Tue, Dec 21, 2010 at 02:48, Ravi Gehlot r...@ravigehlot.net wrote: My point is that you tried to take code from one page and put it all organized in another page and the include that page of includes back into the pages that you want it to feed off from. If stuff works the way that it does then there a reason for it to have been done that way. So you think no one should ever do that because it's only making it look pretty? Ever hear of maintainability? That's why documenting code is so important. 99% doesn't do it (including me). Please cite your source. Personally, I'd even have to admit mine was(and is) less than 99% compatible with what I'd like it to be. -- /Daniel P. Brown Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting (866-) 725-4321 http://www.parasane.net/ -- They're installing the breathalyzer on my email account next week. -- They're installing the breathalyzer on my email account next week. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Include
On Tue, Dec 21, 2010 at 02:35:33AM -0500, David Hutto wrote: On Tue, Dec 21, 2010 at 2:29 AM, Ravi Gehlot r...@ravigehlot.net wrote: Why mess with something that is already working? If you are trying to make it pretty then you are not solving a problem. You are creating one. Define working. I've had programs 'work', but more experienced would say it's flawed in some respect. Does it perform the immediate task? Now define pretty. Is it aesthetically pleasing to you, or to someone else with less, or maybe more experience. By defining the two above, you then define whether it's a problem. To you, or to them, or to the original designer? Beware of more experienced programmers. I recently talked to an ex-boss of mine who had a programmer flake out on him. One of his customers threatened to take this flaky code to another company and get their opinion about whether it was good code or not. My ex-boss explained that, of course, they'd shoot it down. Because that's what programmers do-- they complain about other programmers' code. I'd never heard that idea expressed aloud. But when I thought about it, I realized it was true. Hell, look at the content of this list. ;-} Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Include
If something is working and you don't know exactly whats under the hood then you are wasting your time in trying to re-invent your own wheel and waste your time and resources to modify something that isn't needed to be touched. Good programmers make good use of their time as well. We need to keep in check with new technology, learn new trends and also master our weakness. If we keep changing this or that or moving that or this then oh well...there goes 1 day worth of work to figure stuff out. Just my take on this. If you think different, then no problems. Regards, Ravi. On Tue, Dec 21, 2010 at 10:23 AM, Paul M Foster pa...@quillandmouse.comwrote: On Tue, Dec 21, 2010 at 02:35:33AM -0500, David Hutto wrote: On Tue, Dec 21, 2010 at 2:29 AM, Ravi Gehlot r...@ravigehlot.net wrote: Why mess with something that is already working? If you are trying to make it pretty then you are not solving a problem. You are creating one. Define working. I've had programs 'work', but more experienced would say it's flawed in some respect. Does it perform the immediate task? Now define pretty. Is it aesthetically pleasing to you, or to someone else with less, or maybe more experience. By defining the two above, you then define whether it's a problem. To you, or to them, or to the original designer? Beware of more experienced programmers. I recently talked to an ex-boss of mine who had a programmer flake out on him. One of his customers threatened to take this flaky code to another company and get their opinion about whether it was good code or not. My ex-boss explained that, of course, they'd shoot it down. Because that's what programmers do-- they complain about other programmers' code. I'd never heard that idea expressed aloud. But when I thought about it, I realized it was true. Hell, look at the content of this list. ;-} Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Include
(Apologies for top posting; on my mobile just now.) Not true. Refactoring code is one of the main tasks of a developer. None of us produce perfect code, and some code is less perfect than other code. It's instinct to want to fix bad code when we're maintaining it or having to add new features to it. For the same reason car enthusiasts tinker with and tune their cars, good developers will do the same with code, be it in the form of consolidating common code to include files or other ways. To not do so seems to me to avoid ones nature really! Thanks, Ash http://www.ashleysheridan.co.uk - Reply message - From: Ravi Gehlot r...@ravigehlot.net Date: Tue, Dec 21, 2010 18:12 Subject: [PHP] Problem with Include To: Paul M Foster pa...@quillandmouse.com Cc: php-general@lists.php.net If something is working and you don't know exactly whats under the hood then you are wasting your time in trying to re-invent your own wheel and waste your time and resources to modify something that isn't needed to be touched. Good programmers make good use of their time as well. We need to keep in check with new technology, learn new trends and also master our weakness. If we keep changing this or that or moving that or this then oh well...there goes 1 day worth of work to figure stuff out. Just my take on this. If you think different, then no problems. Regards, Ravi. On Tue, Dec 21, 2010 at 10:23 AM, Paul M Foster pa...@quillandmouse.comwrote: On Tue, Dec 21, 2010 at 02:35:33AM -0500, David Hutto wrote: On Tue, Dec 21, 2010 at 2:29 AM, Ravi Gehlot r...@ravigehlot.net wrote: Why mess with something that is already working? If you are trying to make it pretty then you are not solving a problem. You are creating one. Define working. I've had programs 'work', but more experienced would say it's flawed in some respect. Does it perform the immediate task? Now define pretty. Is it aesthetically pleasing to you, or to someone else with less, or maybe more experience. By defining the two above, you then define whether it's a problem. To you, or to them, or to the original designer? Beware of more experienced programmers. I recently talked to an ex-boss of mine who had a programmer flake out on him. One of his customers threatened to take this flaky code to another company and get their opinion about whether it was good code or not. My ex-boss explained that, of course, they'd shoot it down. Because that's what programmers do-- they complain about other programmers' code. I'd never heard that idea expressed aloud. But when I thought about it, I realized it was true. Hell, look at the content of this list. ;-} Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Include
Hello, Good points. If you are getting paid to do that then fine. There is a difference between enhancing code and wasting time. I do my best to come up with the best I can. I always take notes to perform better in upcoming projects. It is imperative to make good use of time. Unless it is a security issue, no need to waste time. Again, if you are getting paid for it then fine. People tune cars for a reason, they want the attention or the thrill. If you want to tune your code for fun then nobody is against that either :) Ravi. On Tue, Dec 21, 2010 at 1:28 PM, a...@ashleysheridan.co.uk a...@ashleysheridan.co.uk wrote: (Apologies for top posting; on my mobile just now.) Not true. Refactoring code is one of the main tasks of a developer. None of us produce perfect code, and some code is less perfect than other code. It's instinct to want to fix bad code when we're maintaining it or having to add new features to it. For the same reason car enthusiasts tinker with and tune their cars, good developers will do the same with code, be it in the form of consolidating common code to include files or other ways. To not do so seems to me to avoid ones nature really! Thanks, Ash http://www.ashleysheridan.co.uk - Reply message - From: Ravi Gehlot r...@ravigehlot.net Date: Tue, Dec 21, 2010 18:12 Subject: [PHP] Problem with Include To: Paul M Foster pa...@quillandmouse.com Cc: php-general@lists.php.net If something is working and you don't know exactly whats under the hood then you are wasting your time in trying to re-invent your own wheel and waste your time and resources to modify something that isn't needed to be touched. Good programmers make good use of their time as well. We need to keep in check with new technology, learn new trends and also master our weakness. If we keep changing this or that or moving that or this then oh well...there goes 1 day worth of work to figure stuff out. Just my take on this. If you think different, then no problems. Regards, Ravi. On Tue, Dec 21, 2010 at 10:23 AM, Paul M Foster pa...@quillandmouse.com wrote: On Tue, Dec 21, 2010 at 02:35:33AM -0500, David Hutto wrote: On Tue, Dec 21, 2010 at 2:29 AM, Ravi Gehlot r...@ravigehlot.net wrote: Why mess with something that is already working? If you are trying to make it pretty then you are not solving a problem. You are creating one. Define working. I've had programs 'work', but more experienced would say it's flawed in some respect. Does it perform the immediate task? Now define pretty. Is it aesthetically pleasing to you, or to someone else with less, or maybe more experience. By defining the two above, you then define whether it's a problem. To you, or to them, or to the original designer? Beware of more experienced programmers. I recently talked to an ex-boss of mine who had a programmer flake out on him. One of his customers threatened to take this flaky code to another company and get their opinion about whether it was good code or not. My ex-boss explained that, of course, they'd shoot it down. Because that's what programmers do-- they complain about other programmers' code. I'd never heard that idea expressed aloud. But when I thought about it, I realized it was true. Hell, look at the content of this list. ;-} Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Include
On Tue, Dec 21, 2010 at 1:28 PM, a...@ashleysheridan.co.uk a...@ashleysheridan.co.uk wrote: (Apologies for top posting; on my mobile just now.) Not true. Refactoring code is one of the main tasks of a developer. None of us produce perfect code, and some code is less perfect than other code. It's instinct to want to fix bad code when we're maintaining it or having to add new features to it. For the same reason car enthusiasts tinker with and tune their cars, good developers will do the same with code, be it in the form of consolidating common code to include files or other ways. To not do so seems to me to avoid ones nature really! Thanks, Ash http://www.ashleysheridan.co.uk - Reply message - From: Ravi Gehlot r...@ravigehlot.net Date: Tue, Dec 21, 2010 18:12 Subject: [PHP] Problem with Include To: Paul M Foster pa...@quillandmouse.com Cc: php-general@lists.php.net If something is working and you don't know exactly whats under the hood then you are wasting your time in trying to re-invent your own wheel and waste your time and resources to modify something that isn't needed to be touched. Good programmers make good use of their time as well. We need to keep in check with new technology, learn new trends and also master our weakness. If we keep changing this or that or moving that or this then oh well...there goes 1 day worth of work to figure stuff out. Just my take on this. If you think different, then no problems. Regards, Ravi. On Tue, Dec 21, 2010 at 10:23 AM, Paul M Foster pa...@quillandmouse.comwrote: On Tue, Dec 21, 2010 at 02:35:33AM -0500, David Hutto wrote: On Tue, Dec 21, 2010 at 2:29 AM, Ravi Gehlot r...@ravigehlot.net wrote: Why mess with something that is already working? If you are trying to make it pretty then you are not solving a problem. You are creating one. Define working. I've had programs 'work', but more experienced would say it's flawed in some respect. Does it perform the immediate task? Now define pretty. Is it aesthetically pleasing to you, or to someone else with less, or maybe more experience. By defining the two above, you then define whether it's a problem. To you, or to them, or to the original designer? Beware of more experienced programmers. I recently talked to an ex-boss of mine who had a programmer flake out on him. One of his customers threatened to take this flaky code to another company and get their opinion about whether it was good code or not. My ex-boss explained that, of course, they'd shoot it down. Because that's what programmers do-- they complain about other programmers' code. I'd never heard that idea expressed aloud. But when I thought about it, I realized it was true. Hell, look at the content of this list. ;-} Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php +1 -- Bastien Cat, the other other white meat -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Include
On Mon, Dec 20, 2010 at 02:49, Simcha Younger sim...@syounger.com wrote: Since it is being included by PHP, and not served by Apache, the extension is not important. Correct, but keep in mind that it will likely be served as plain text if accessed directly, if the web server is not properly configured (which, by default, it isn't). -- /Daniel P. Brown Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting (866-) 725-4321 http://www.parasane.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Include
Why mess with something that is already working? If you are trying to make it pretty then you are not solving a problem. You are creating one. Ravi. On Mon, Dec 20, 2010 at 7:40 AM, Daniel P. Brown daniel.br...@parasane.netwrote: On Mon, Dec 20, 2010 at 02:49, Simcha Younger sim...@syounger.com wrote: Since it is being included by PHP, and not served by Apache, the extension is not important. Correct, but keep in mind that it will likely be served as plain text if accessed directly, if the web server is not properly configured (which, by default, it isn't). -- /Daniel P. Brown Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting (866-) 725-4321 http://www.parasane.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Include
On Tue, Dec 21, 2010 at 2:29 AM, Ravi Gehlot r...@ravigehlot.net wrote: Why mess with something that is already working? If you are trying to make it pretty then you are not solving a problem. You are creating one. Define working. I've had programs 'work', but more experienced would say it's flawed in some respect. Does it perform the immediate task? Now define pretty. Is it aesthetically pleasing to you, or to someone else with less, or maybe more experience. By defining the two above, you then define whether it's a problem. To you, or to them, or to the original designer? Ravi. On Mon, Dec 20, 2010 at 7:40 AM, Daniel P. Brown daniel.br...@parasane.netwrote: On Mon, Dec 20, 2010 at 02:49, Simcha Younger sim...@syounger.com wrote: Since it is being included by PHP, and not served by Apache, the extension is not important. Correct, but keep in mind that it will likely be served as plain text if accessed directly, if the web server is not properly configured (which, by default, it isn't). -- /Daniel P. Brown Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting (866-) 725-4321 http://www.parasane.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- They're installing the breathalyzer on my email account next week. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Include
My point is that you tried to take code from one page and put it all organized in another page and the include that page of includes back into the pages that you want it to feed off from. If stuff works the way that it does then there a reason for it to have been done that way. That's why documenting code is so important. 99% doesn't do it (including me). Ravi. On Tue, Dec 21, 2010 at 2:35 AM, David Hutto smokefl...@gmail.com wrote: On Tue, Dec 21, 2010 at 2:29 AM, Ravi Gehlot r...@ravigehlot.net wrote: Why mess with something that is already working? If you are trying to make it pretty then you are not solving a problem. You are creating one. Define working. I've had programs 'work', but more experienced would say it's flawed in some respect. Does it perform the immediate task? Now define pretty. Is it aesthetically pleasing to you, or to someone else with less, or maybe more experience. By defining the two above, you then define whether it's a problem. To you, or to them, or to the original designer? Ravi. On Mon, Dec 20, 2010 at 7:40 AM, Daniel P. Brown daniel.br...@parasane.netwrote: On Mon, Dec 20, 2010 at 02:49, Simcha Younger sim...@syounger.com wrote: Since it is being included by PHP, and not served by Apache, the extension is not important. Correct, but keep in mind that it will likely be served as plain text if accessed directly, if the web server is not properly configured (which, by default, it isn't). -- /Daniel P. Brown Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting (866-) 725-4321 http://www.parasane.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- They're installing the breathalyzer on my email account next week.
Re: [PHP] Problem with Include
$file_name= basename($_SERVER['PHP_SELF']); $last_modified = filemtime($file_name); print(This page last modified ); print(date(m/j/y, $last_modified)); you need to wrap the contents ^^^ of the include file with ? php ? Govinda -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Include
On Dec 19, 2010, at 10:43 AM, Bill Guion wrote: In an effort to clean up some code, I tried taking four lines out of 6 or 7 programs and putting them into an include file. The file structure is Root data clubs.php include fmt.inc Originally, clubs.php had the following code: ?PHP $file_name= basename($_SERVER['PHP_SELF']); $last_modified = filemtime($file_name); print(This page last modified ); print(date(m/j/y, $last_modified)); ? This code works - on the web page I get This page last modified 12/18/2010 which is correct. So then I did the following: Create an include file, fmt.inc with the following code: $file_name= basename($_SERVER['PHP_SELF']); $last_modified = filemtime($file_name); print(This page last modified ); print(date(m/j/y, $last_modified)); and then in the original file, I have ?PHP include ../include/fmt.inc; ? On my web page, I then get $file_name= basename($_SERVER['PHP_SELF']);$last_modified = filemtime($file_name);print(This page last modified ); print(date(m/j/y, $last_modified)); (all on one line). I would really like to understand why the include construct doesn't give the same results as the original? -= Bill =- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Whenever you see PHP code emitted to the web page, it means it wasn't wrapped in ?php..?. If your include file above is complete, it's missing these tags. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Include
Is your server even set up to recognise .inc files as php? You can't just put any old extension on and expect the server to know what to do with it. Thanks, Ash http://www.ashleysheridan.co.uk - Reply message - From: Tamara Temple tamouse.li...@gmail.com Date: Sun, Dec 19, 2010 17:07 Subject: [PHP] Problem with Include To: Bill Guion bgu...@comcast.net Cc: php-general@lists.php.net On Dec 19, 2010, at 10:43 AM, Bill Guion wrote: In an effort to clean up some code, I tried taking four lines out of 6 or 7 programs and putting them into an include file. The file structure is Root data clubs.php include fmt.inc Originally, clubs.php had the following code: ?PHP $file_name= basename($_SERVER['PHP_SELF']); $last_modified = filemtime($file_name); print(This page last modified ); print(date(m/j/y, $last_modified)); ? This code works - on the web page I get This page last modified 12/18/2010 which is correct. So then I did the following: Create an include file, fmt.inc with the following code: $file_name= basename($_SERVER['PHP_SELF']); $last_modified = filemtime($file_name); print(This page last modified ); print(date(m/j/y, $last_modified)); and then in the original file, I have ?PHP include ../include/fmt.inc; ? On my web page, I then get $file_name= basename($_SERVER['PHP_SELF']);$last_modified = filemtime($file_name);print(This page last modified ); print(date(m/j/y, $last_modified)); (all on one line). I would really like to understand why the include construct doesn't give the same results as the original? -= Bill =- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Whenever you see PHP code emitted to the web page, it means it wasn't wrapped in ?php..?. If your include file above is complete, it's missing these tags. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Include
On Sun, 19 Dec 2010 17:41:20 + a...@ashleysheridan.co.uk a...@ashleysheridan.co.uk wrote: Is your server even set up to recognise .inc files as php? You can't just put any old extension on and expect the server to know what to do with it. Thanks, Ash http://www.ashleysheridan.co.uk Since it is being included by PHP, and not served by Apache, the extension is not important. -- Simcha Younger sim...@syounger.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with include directive under XHTML
Uh, guys? Nevermind. To quote someone's .sig: The truth was out there, but the lies were in my mind. I cleared out a couple of mis-conceptions, and the problem went away. Sorry for the noise. Robert Huff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with include directive under XHTML
Robbert van Andel writes: I've had this problem. It's because of the ? and ? that surrounds your XML. Your php configuration probably has short tags enabled. Negative, Prior research found this problem, and the short tags setting, which was promptly set to OFF, Robert Huff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with include directive under XHTML
What is the error message you are getting? On Tue, Jun 3, 2008 at 11:37 AM, Robert Huff [EMAIL PROTECTED] wrote: Robbert van Andel writes: I've had this problem. It's because of the ? and ? that surrounds your XML. Your php configuration probably has short tags enabled. Negative, Prior research found this problem, and the short tags setting, which was promptly set to OFF, Robert Huff
Re: [PHP] problem with include directive under XHTML
I've had this problem. It's because of the ? and ? that surrounds your XML. Your php configuration probably has short tags enabled. I have had to use php to output this ?PHP echo ' ?xml version=1.0 encoding=utf-8?' ; ? On Tue, Jun 3, 2008 at 7:25 AM, Robert Huff [EMAIL PROTECTED] wrote: I'm working on a project that involves converting HTML to XHTML. Not strictly sure this is a PHP issue, but testing (so far) has eliminated other possibilities. Can someone offer suggestions why, on the same server (Apache 2.2.8), this works: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN html lang=en-US head link rel=stylesheet type=text/css href=proj_default.css title=ss_default titleTesting html/title /head body script language=php include 'letters/Disclaimer'; /script hr addressa href=mailto:[EMAIL PROTECTED]Robert Huff/a/address !-- Created: Wed Jan 19 10:52:50 EST 2005 -- !-- hhmts start -- Last modified: Mon Jun 2 16:56:19 EDT 2008 !-- hhmts end -- /body /html but this doesn't: ?xml version=1.0 encoding=utf-8? !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.1//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; html xmlns=http://www.w3.org/1999/xhtml; head titleTesting xhtml/title link rel=stylesheet type=text/css href=proj_default.css title=ss_default / link rel=icon type=image/x-icon href=images/favicon.png / link rel=shortcut icon type=image/x-icon href=images/favicon.png / /head body script type=text/php include 'letters/Disclaimer'; /script hr / addressa href=mailto:[EMAIL PROTECTED]Robert Huff/a/address !-- Created: Wed Jan 19 10:52:50 EST 2005 -- !-- hhmts start -- Last modified: Mon Jun 2 17:37:52 EDT 2008 !-- hhmts end -- /body /html Rspectfully, Robert Huff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Include function using Apache 2.0 and PHP 5 on W2K3 Server
Dave Adler wrote: I am new to PHP and Apache. I am trying to use the include function to include a file that has my web page header and menu, similar to what I used to do with SSI. The content of the include file doesn't display. Instead, I get a link that says function.main and below that I get a link that says function.include I can run other PHP code with no problem. The include files are in a folder below the doc root called Includes. This is running on Windows 2003 Server. I did a default install of Apache 2.0 and PHP 5. This is probably a settig in httpd.conf or php.ini but I can't seem to find it in the docs. Hunh? Give us a link to your page, or use View Source on the browser and post the HTML you got for the include parts. There's NO WAY you could have literally managed to break PHP's include statement -- So you've got to be doing something else wrong. Perhaps your include_path setting is not what you want? -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Include function using Apache 2.0 and PHP 5 on W2K3 Server
Richard, Thanks for the feedback. The reference to the file location was the problem. My include statement was include(/includes/menu.inc); I changed it to include ($_SERVER[DOCUMENT_ROOT]./includes/menu.inc); This solved the problem. David Richard Lynch [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Dave Adler wrote: I am new to PHP and Apache. I am trying to use the include function to include a file that has my web page header and menu, similar to what I used to do with SSI. The content of the include file doesn't display. Instead, I get a link that says function.main and below that I get a link that says function.include I can run other PHP code with no problem. The include files are in a folder below the doc root called Includes. This is running on Windows 2003 Server. I did a default install of Apache 2.0 and PHP 5. This is probably a settig in httpd.conf or php.ini but I can't seem to find it in the docs. Hunh? Give us a link to your page, or use View Source on the browser and post the HTML you got for the include parts. There's NO WAY you could have literally managed to break PHP's include statement -- So you've got to be doing something else wrong. Perhaps your include_path setting is not what you want? -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with include()
Hello Jason, Monday, November 1, 2004, 10:34:16 PM, you wrote: JD the login page is included ... the login page does not see the auth JD cookie until the user refreshes their browser ... why is this happening? Cookies (set via setcookie) are not available to you on the same page as you set them. The function is a means to send a special header to the browser that makes it create the cookie when the page loads which, at this point in your script, hasn't happened yet. If you are including the login.php script further down the page then rather than checking for the cookie itself, why not just check for the original value you set the cookie to? Best regards, Richard Davey -- http://www.launchcode.co.uk - PHP Development Services I am not young enough to know everything. - Oscar Wilde -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] problem with include()
How did you go to the page that included the login page, if you included it in the tiny_edit.php (which is the routine that sets the cookie in the browser, you need to cause the browser to send it back to you by doing a redirect; Header(Location: tiny_edit.php); Exit; When tiny_edit is entered the second time it should be able to retrieve the cookie. (this is basically what you are doing manually by refreshing the browser). HTH, Warren Vail -Original Message- From: Jason Davis [mailto:[EMAIL PROTECTED] Sent: Monday, November 01, 2004 2:34 PM To: PHP General List Subject: [PHP] problem with include() Hello, I have a login page .. the user types in user and pass then the form gets posted to tiny_edit.php tiny_edit.php checks user and pass then sets a cookie if auth is successful. Then the original login page is included. The login page has logic at the top to check for the auth cookie ... if there, it sends user to home page .. if not it displays the login screen. This works mostly except ... when the user auths ... the cookie gets set ... then the login page is included .. the login page does not see the auth cookie until the user refreshes their browser ... why is this happening? thanks, jd login page ?php $bt = new AuthTool(); if($username = $bt-checkAuth()){ //send to homepage print you are already logged on $username; } ? html head title Tiny Edit Login /title link rel=stylesheet type=text/css href=inc/tiny_edit.css / /head body form action=?php echo $_SERVER['PHP_SELF']; ? method=post table width=240 cellspacing=0 border=0 tr td width=100% class=white align=center bTiny Edit Login/b /td /tr /table table width=240 cellspacing=0 border=0 tr td class=grey width=120 align=centerUser:/tdtd class=grey width=100input type=text name=user/td /tr tr td class=grey width=120 align=centerPass:/tdtd class=grey width=100input type=password name=pass/td /tr /table table width=240 cellspacing=0 border=0 tr td width=100% class=white align=right input type=submit value=Login class=submitstyle /td /tr /table form /body /html tiny_edit.php if(!$_GET['instance'] !$_POST['instance']){ $at = new AuthTool(); if($_POST['user'] $_POST['pass']){ $at-auth($_POST['user'],$_POST['pass']); //this sets cookie if user and pass are correct } include inc/tiny_edit_login.inc.php; } thanks, jd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with include()
On Mon, 2004-11-01 at 16:08, Richard Davey wrote: Hello Jason, Monday, November 1, 2004, 10:34:16 PM, you wrote: JD the login page is included ... the login page does not see the auth JD cookie until the user refreshes their browser ... why is this happening? Cookies (set via setcookie) are not available to you on the same page as you set them. The function is a means to send a special header to the browser that makes it create the cookie when the page loads which, at this point in your script, hasn't happened yet. If you are including the login.php script further down the page then rather than checking for the cookie itself, why not just check for the original value you set the cookie to? Best regards, Richard Davey thanks a lot Richard :) I was just about to email this simple test case ... so even tho you told me the answer I,ll post so someone else might use it i am misunderstanding cookies and/or include() ... please look at this code... sc.php ?php setCookie('data' , 'blah'); include 'gc.php'; ? gc.php ?php print $_COOKIE['data'] . -here; ? this is the out put of running sc.php -here why is this , i want to set a cookie ... then have a include do something with it ... is this not possible to do during the same http transaction? thanks -- http://www.launchcode.co.uk - PHP Development Services I am not young enough to know everything. - Oscar Wilde -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with include()
On Mon, 2004-11-01 at 16:10, Vail, Warren wrote: How did you go to the page that included the login page, if you included it in the tiny_edit.php (which is the routine that sets the cookie in the browser, you need to cause the browser to send it back to you by doing a redirect; Header(Location: tiny_edit.php); Exit; When tiny_edit is entered the second time it should be able to retrieve the cookie. (this is basically what you are doing manually by refreshing the browser). HTH, Warren Vail yeah baby! thas what im talkin bout! thanks a lot :p if(!$_GET['instance'] !$_POST['instance']){ $at = new AuthTool(); if($_POST['user'] $_POST['pass']){ $at-auth($_POST['user'],$_POST['pass']); //set cookie Header(Location: tiny_edit.php); Exit; } include inc/tiny_edit_login.inc.php; } thanks again all, jd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with include()
On Mon, 2004-11-01 at 16:26, Brad Dameron wrote: On Mon, 2004-11-01 at 15:17, Jason Davis wrote: sc.php ?php setCookie('data' , 'blah'); include 'gc.php'; ? gc.php ?php print $_COOKIE['data'] . -here; ? this is the out put of running sc.php -here why is this , i want to set a cookie ... then have a include do something with it ... is this not possible to do during the same http transaction? thanks Your setcookie line is wrong. You have a uppercase C. Which it will think it is a different function. Also with your login page instead of sending them to another page to check auth send them to the same page. Here is a example: if (isset($_GET['user']) $_GET['type'] == submit) { $user = trim($_POST['user']); $pass = trim($_POST['pass']); if ( 1 == $autherror=authenticateUser($user, $pass)){ $_SESSION['app_user'] = $user; $_SESSION['app_pass'] = $pass; error_log (DNS_LOGIN: $user logged in from ip: $ip., 0); header(Location: tiny_edit_login.inc.php); exit; } else { error_log ($user failed on . date(m-d-Y H:i:s) . with password of '$pass' from ip: $ip, 0); } } I return back a 1 if auth successful or a 0 if not. I prefer to use session's with cookies over cookies directly. Brad i like this idea , how then do you go about making sure users are authed on pages other than the login page? here is my plan ... use this object for auth ?php $seed_phrase = 'my_wife_Would_love_it_no_really'; $use_mysql = '0'; // set to one and fill in $mysql_vars else set to 0 and file in $passwdFile var rel or full path $mysql_ip = '1.1.1.1'; $mysql_user = 'nub'; $mysql_pass = 'nubpasswd'; $mysql_db = 'testdb'; $mysql_passwd_key = 'username'; $mysql_passwd_field = 'password'; $mysql_table = 'users'; $passwdFile = '/var/www/web_editor/.htAuthTool'; class AuthTool{ function checkAuth(){ if(empty($_COOKIE['data'])){ return 0; } else{ $data = $_COOKIE['data']; list($username,$hash) = split(,, $data); $phrase1 = md5($username . $seed_phrase . $_SERVER['REMOTE_ADDR']); if(!strcmp($phrase1 , $hash)){ return $username; } else{ return 0; } } } // close checkAuth function cookiePut($user){ $phrase = md5($user . $seed_phrase . $_SERVER['REMOTE_ADDR']); $authData = $user . , . $phrase; setCookie('data' , $authData); }//close cookiePut function auth($user,$pass){ $pass = md5($pass); if($use_mysql){ $query = select $mysql_passwd_field from $mysql_table where $mysql_passwd_key = '$user'; $result = $this-sqlQuery($query); if(!$result){ echo Error:No sql result; } else{ list($thePass) = mysql_fetch_array($result); //this line might not work , test with mysql later if(!strcmp($thePass , $pass)){ $this-cookiePut($user); return $user; } } return 0; } else{ global $passwdFile; if($passwd_file = file($passwdFile)){ foreach($passwd_file as $line){ list($username,$passwd,$groups) = split(: , $line); if(!strcmp($username , $user)){ if(!strcmp(rtrim($pass) ,rtrim($passwd))){ $this-cookiePut($user); return $user; } } } } else{ return Error:No passwd file.; } return 0; } }//close auth function sqlQuery($theQuery){ $db = mysql_connect($mysql_ip,$mysql_user,$mysql_pass) or die(Could not connect to database); mysql_select_db($mysql_db) or die(Could not select database); $result =
Re: [PHP] Problem with include();
Hello, It's often said that includes should have relative paths instead of absolute paths. This ensures that your script still works when you move it to a different server. So if an error has forced you to use rel paths consider it a blessing in disguise :-) Ty Lamb wrote: /index.php has include(/code/includes/page_header.php); /docs/aaryn/dmb/dave.php has include(/code/includes/page_header.php); Both are identical lines of code. Index.php works but dave.php returns the following: Warning: Failed opening '/code/includes/page_header.php' for inclusion (include_path='.;c:\php4\pear') in C:\x\x\x\x\x\aaryn\dmb\dave.php on line 4 but if I change the code in dave.php to include '../../../code/includes/page_header.php'; It works. Why? Is there any way around this? Please tell me I'm doing something wrong and it's not supposed to work like this!!! Ty... -- http://www.radinks.com/upload Drag and Drop File Uploader. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with include();
* Thus wrote Ty Lamb ([EMAIL PROTECTED]): /index.php has include(/code/includes/page_header.php); /docs/aaryn/dmb/dave.php has include(/code/includes/page_header.php); Both are identical lines of code. Index.php works but dave.php returns the following: Warning: Failed opening '/code/includes/page_header.php' for inclusion (include_path='.;c:\php4\pear') in C:\x\x\x\x\x\aaryn\dmb\dave.php on line 4 but if I change the code in dave.php to include '../../../code/includes/page_header.php'; ahh.. so your code/ is at your webroot (the same directory as index.php?) I would have expected the /code to look at c:\code\includes\page_header.php But it seems that this isn't the case and I'm not familiar with how windows handles the absolute path. It works. Why? Is there any way around this? Please tell me I'm doing something wrong and it's not supposed to work like this!!! What I would suggest is to setup your include_path to look something like: include_path=.;c:\php4\pear;c:\path\to\code\includes Then your include will simply be include(page_header.php); Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Include
Thanks to all whom answered me while there is no solution for my problem (including more than one PHP file in a HTML page through SSI) :( I want to return to my server old configuration, It was: RedHat Linux 7.3 Apach 1.3 PHP 4.0.1 except PHP, because I have encountered some problems with PHP 4.0.1, and please tell me what I (exactly) suppose to reinstall (Linux,Apache or PHP)... Is there any way to undo my upgrade ( what I call downgrade :-) )? thanx anyway __ http://www.sport4ever.net Administrator of Sport4ever.Net [EMAIL PROTECTED] - Original Message - From: sport4ever [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: Tom Ray [EMAIL PROTECTED] Sent: Tuesday, December 24, 2002 8:04 AM Subject: Re: [PHP] Problem with Include It's PHP problem because I can include any number of files with other extensions. only PHP which I can not include more than one file at a page... maybe there is something wrong with php.ini notice that I faced with this problem just after I upgraded to (PHP 4.2.1), (Apache2), everything was great before! sport4ever wrote: Hello, my problem is that I can't use more than one SSI INCLUDE in a page Please access this test page to check the problem yourself: http://www.sport4ever.com/test/hello.shtml The first INCLUDE will appear correctly and prints HELLO World, include #1 which is the output of hello.php Whereas the second INCLUDE won't appear, and instead, it will print the content (code) of hello2.php, which is the follwoing: ? echo HELLO World, include #1; ? So, it always executes the first include statement perfectly, and doesn't execute the rest! note: the problem appears only if I include a PHP file, it will execute it correctly if it's a SHTML or HTML file. PLEASE is there any solution for this strange problem! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Include
At 08:04 AM 12/24/02 +0300, sport4ever wrote: maybe there is something wrong with php.ini notice that I faced with this problem just after I upgraded to (PHP 4.2.1), (Apache2), everything was great before! The last I heard PHP + Apache2 is pretty much experimental, and not recommended for production servers. Unless you plan on working to debug the combination of programs, you should be using Apache 1.3 if you want to use PHP. There are a few combinations of versions that work together, but unless you are willing to put a lot of extra effort and study into using Apache 2, stick with 1.3 until the PHP developers announce Apache 2 support. Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Include
I have found this to be very true with RedHat 8 (includes Apache2.0.40, and php 4.2.2). While RedHat 8.0 isn't really ready for a production server, apache2 and php definitly are not. You have to bend over backwards to get some things working correctly if at all. Plus there are still some stability issues with RH 8. As far as my production servers go apache 1.3 and RH 7.3 for now. On Tue, 24 Dec 2002 00:02:49 -0700 Rick Widmer [EMAIL PROTECTED] wrote: At 08:04 AM 12/24/02 +0300, sport4ever wrote: maybe there is something wrong with php.ini notice that I faced with this problem just after I upgraded to (PHP 4.2.1),(Apache2), everything was great before! The last I heard PHP + Apache2 is pretty much experimental, and not recommended for production servers. Unless you plan on working to debug the combination of programs, you should be using Apache 1.3 if you want to use PHP. There are a few combinations of versions that work together, but unless you are willing to put a lot of extra effort and study into using Apache 2, stick with 1.3 until the PHP developers announce Apache 2 support. -- Tom Woody Systems Administrator Don't throw your computer out the window, throw the Windows out of your computer! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Include
I've heard that RH8 decided to disable short tags in their default php.ini If this is true, the people at RedHat deserve a good spanking. Talk about being irresponsible! Regards, Philip On Tue, 24 Dec 2002, Tom Woody wrote: I have found this to be very true with RedHat 8 (includes Apache2.0.40, and php 4.2.2). While RedHat 8.0 isn't really ready for a production server, apache2 and php definitly are not. You have to bend over backwards to get some things working correctly if at all. Plus there are still some stability issues with RH 8. As far as my production servers go apache 1.3 and RH 7.3 for now. On Tue, 24 Dec 2002 00:02:49 -0700 Rick Widmer [EMAIL PROTECTED] wrote: At 08:04 AM 12/24/02 +0300, sport4ever wrote: maybe there is something wrong with php.ini notice that I faced with this problem just after I upgraded to (PHP 4.2.1),(Apache2), everything was great before! The last I heard PHP + Apache2 is pretty much experimental, and not recommended for production servers. Unless you plan on working to debug the combination of programs, you should be using Apache 1.3 if you want to use PHP. There are a few combinations of versions that work together, but unless you are willing to put a lot of extra effort and study into using Apache 2, stick with 1.3 until the PHP developers announce Apache 2 support. -- Tom Woody Systems Administrator Don't throw your computer out the window, throw the Windows out of your computer! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with Include
It's PHP problem because I can include any number of files with other extensions. only PHP which I can not include more than one file at a page... maybe there is something wrong with php.ini notice that I faced with this problem just after I upgraded to (PHP 4.2.1), (Apache2), everything was great before! - Original Message - From: Tom Ray [EMAIL PROTECTED] To: sport4ever [EMAIL PROTECTED] Sent: Tuesday, December 24, 2002 6:03 AM Subject: Re: [PHP] Problem with Include You need to post your code that you are usingthis isn't really a PHP problem this is a SSI problem... sport4ever wrote: Hello, my problem is that I can't use more than one SSI INCLUDE in a page Please access this test page to check the problem yourself: http://www.sport4ever.com/test/hello.shtml The first INCLUDE will appear correctly and prints HELLO World, include #1 which is the output of hello.php Whereas the second INCLUDE won't appear, and instead, it will print the content (code) of hello2.php, which is the follwoing: ? echo HELLO World, include #1; ? So, it always executes the first include statement perfectly, and doesn't execute the rest! note: the problem appears only if I include a PHP file, it will execute it correctly if it's a SHTML or HTML file. PLEASE is there any solution for this strange problem! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with include
hmm. It should have nothing to do with cookies unless you are using cookies in the scripts. Try using require rather than include to see if that makes any difference Cheers John Wards SportNetwork.net p.s. your english is as good as mine and i am scottish.. - Original Message - From: skitum [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 30, 2002 11:53 AM Subject: [PHP] problem with include Hi all, Look at this code: // one.php ? include(two.php); ? --- html code --- // end file one.php // two.php ? include(three.php); ? --- html code --- //end two.php well, when I see in my browser www.myweb.com/two.php this shows two.php plus the include file in it three.php, so this works ok, but when i see in my browser (IE 6.0) www.myweb.com/one.php this shows one.php plus two.php, but not three.php that is include into two.php What am I doing wrong? Could be this because of cookies? Thanks for help Peace Love skitum P.S. Forgive my bad english. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with include
The same problem with require - Original Message - From: John Wards [EMAIL PROTECTED] To: skitum [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, August 30, 2002 1:02 PM Subject: Re: [PHP] problem with include hmm. It should have nothing to do with cookies unless you are using cookies in the scripts. Try using require rather than include to see if that makes any difference Cheers John Wards SportNetwork.net p.s. your english is as good as mine and i am scottish.. - Original Message - From: skitum [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 30, 2002 11:53 AM Subject: [PHP] problem with include Hi all, Look at this code: // one.php ? include(two.php); ? --- html code --- // end file one.php // two.php ? include(three.php); ? --- html code --- //end two.php well, when I see in my browser www.myweb.com/two.php this shows two.php plus the include file in it three.php, so this works ok, but when i see in my browser (IE 6.0) www.myweb.com/one.php this shows one.php plus two.php, but not three.php that is include into two.php What am I doing wrong? Could be this because of cookies? Thanks for help Peace Love skitum P.S. Forgive my bad english. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with include
hmmbeyond my scope...but I did the following to test ?//file one.php echoone; include (two.php); ? ?//file two.php echotwo; include (three.php); ? ?//file three.php echothree; ? And it echoed onetwothree must be some setting on your system but what I don't knwo John - Original Message - From: skitum [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 30, 2002 12:06 PM Subject: Re: [PHP] problem with include The same problem with require - Original Message - From: John Wards [EMAIL PROTECTED] To: skitum [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, August 30, 2002 1:02 PM Subject: Re: [PHP] problem with include hmm. It should have nothing to do with cookies unless you are using cookies in the scripts. Try using require rather than include to see if that makes any difference Cheers John Wards SportNetwork.net p.s. your english is as good as mine and i am scottish.. - Original Message - From: skitum [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 30, 2002 11:53 AM Subject: [PHP] problem with include Hi all, Look at this code: // one.php ? include(two.php); ? --- html code --- // end file one.php // two.php ? include(three.php); ? --- html code --- //end two.php well, when I see in my browser www.myweb.com/two.php this shows two.php plus the include file in it three.php, so this works ok, but when i see in my browser (IE 6.0) www.myweb.com/one.php this shows one.php plus two.php, but not three.php that is include into two.php What am I doing wrong? Could be this because of cookies? Thanks for help Peace Love skitum P.S. Forgive my bad english. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with include/require
Hi Yasuo, Thanks for the reply, but yes I do know that the include_path in php.ini should have the entries. But is this something new? I want to know how to allow including and requiring files just like we used to do in PHP3! For instance, let us say that we have two software programs on the server which are completely unrelated (I use Windows platform, so here it is): c:\apache\htdocs\software1\includes c:\apache\htdocs\software2\includes Now with the latest PHP I have to include both these above paths in my PHP.INI's "include_path" directive. is there a way to avoid this, and only include the "c:\apache\htdocs"? Yes, I know that I can make a common INCLUDES folder, but come on lets be practical. It is a lot cleaner if we can have an include folder INSIDE the software-specific folder. Any ideas would be greatly appreciated! Thanks/Erick --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.237 / Virus Database: 115 - Release Date: 07-Mar-01 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] problem with include/require
- Original Message - From: "Erick Papadakis" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, March 11, 2001 9:05 PM Subject: Re: [PHP] problem with include/require Hi Yasuo, Thanks for the reply, but yes I do know that the include_path in php.ini should have the entries. But is this something new? I want to know how to allow including and requiring files just like we used to do in PHP3! For instance, let us say that we have two software programs on the server which are completely unrelated (I use Windows platform, so here it is): c:\apache\htdocs\software1\includes c:\apache\htdocs\software2\includes Now with the latest PHP I have to include both these above paths in my PHP.INI's "include_path" directive. is there a way to avoid this, and only include the "c:\apache\htdocs"? Hmm. I can put multiple includes directory on my system (PHP4.0.4pl1/Linux/Apache) include_path = /home/httpd/include1:/home/httpd/include2 Getting rid of spaces around "=" might help. (It should work with spaces/tab, though) Yes, I know that I can make a common INCLUDES folder, but come on lets be practical. It is a lot cleaner if we can have an include folder INSIDE the software-specific folder. I have different approch for 2 reasons 1) Multiple include path may result in unintetional includes of files. For example, include_for_aap1.inc and include_for_app2.inc may mixed up easily. 2) Multiple include path sacrifices performance. System need to search all include path for files to be included. Therefore, I specify only 1 directory for include_path. I have global.app_name.inc for each apps and defines constant, like define('INCLUDE_PATH','/home/httpd/include_path_for_app1'); and I write include_once(INCLUDE_PATH.'file_to_include.inc'); for all other files to be included. This this method, you still can esiliy change include_path esily and you can have different include directory for each application AND save COU time to find files to include. This is my approch for inlucding files. Any ideas would be greatly appreciated! Thanks/Erick --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.237 / Virus Database: 115 - Release Date: 07-Mar-01 Yasuo Ohgaki == PHP and Related Resources == [PHP FAQ] http://www.php.net/FAQ.php [PHP Manual] http://www.php.net/manual/en/ [W3C] http://www.w3.org/ [RFCs] http://www.faqs.org/rfcs/ If you don't read standard definitions, I recommend to read them. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] problem with include/require
""Erick Papadakis"" [EMAIL PROTECTED] wrote in message 98einl$rpl$[EMAIL PROTECTED]">news:98einl$rpl$[EMAIL PROTECTED]... i installed my php on my windows machine using the "php triad" software which i downloaded from www.sourceforge.net. however, now i have a problem with "include" command. for everything i wish to include into my programs, i need to speficy this folder in the "include_path" inside my php.ini. can i change this configuration? Sounds like all you need to is edit include_path line your php.ini correctly. If you are setting include_path right, are you sure you don't have typo? Refer to http://www.php.net/manual/en/configuration.php Regards, -- Yasuo Ohgaki for example, lets say i have a directory called: c:/apache/htdocs/phpprograms/ inside this phpprograms, i have the following files: class_include.phpi actual_program.php inside my "actual_program.php", i require the "class_include.phpi", but this gives me a runtime error. i think it must be some configuration problem? i would appreciate if someone can tell me how to do this! cheers/erick --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.237 / Virus Database: 115 - Release Date: 07-Mar-01 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]