Re: [PHP] Include problems
On Sat, Apr 12, 2008 at 11:06 PM, Bojan Tesanovic [EMAIL PROTECTED] wrote: On Apr 12, 2008, at 8:28 AM, GoWtHaM NaRiSiPaLli wrote: if(file_exists(../common/config.ini)) { $configData = parse_ini_file(../common/config.ini); } else { Try changing above code so it reads if(file_exists(common/config.ini)) { $configData = parse_ini_file(common/config.ini); } else { In your primary file, you could also consider adding: ?php $base_path = dirname(__FILE__); ? And then, all includes from within that file would be included as such: ?php include($base_path.'/common/config.ini'); ? Finally, on a different note, it may not be in your best interest to keep a .ini extension on a configuration file, since this is generally readable on the web. -- /Daniel P. Brown Ask me about: Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo., and shared hosting starting @ $2.50/mo. Unmanaged, managed, and fully-managed! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include problems
On Apr 12, 2008, at 8:28 AM, GoWtHaM NaRiSiPaLli wrote: if(file_exists(../common/config.ini)) { $configData = parse_ini_file(../common/config.ini); } else { Try changing above code so it reads if(file_exists(common/config.ini)) { $configData = parse_ini_file(common/config.ini); } else { As the xyz.php is in /var/www/sites/project/ folder , and that is the starting path of the script so any script that needs to include /var/www/sites/project/common/someFile.php you need to specify relative path to '/var/www/sites/project/' which is 'common/someFile.php' this should work unless some of included files uses 'chdir' function that changes current directory Igor Jocic http://www.carster.us/ Used Car Classifieds
Re: [PHP] include() problems
Gustave Bernier wrote: I'm new to PHP and I'm trying to use the include function but with no success... My server's ini file is set as (allow_url_fopen, 0) so I'm having some trouble to pass different values for the php file I'm calling. The address is: http://mydomain.com/forums/ssi.php?a=active The code I'm trying now is: $_GET['a'] = 'active'; include('forums/ssi.php'); Well, since everyone has commented on the including-same-file idea, might I point that this : $_GET['a'] = 'active'; looks a bit strange. -- Burhan Khalid phplist[at]meidomus[dot]com http://www.meidomus.com Tip : In your replies, please trim out the signature of person you are replying to. No need to see the same disclaimer 5 times. Leads to bloat. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] include() problems
Gustave Bernier mailto:[EMAIL PROTECTED] on Thursday, October 02, 2003 6:20 AM said: The address is: http://mydomain.com/forums/ssi.php?a=active The code I'm trying now is: $_GET['a'] = 'active'; include('forums/ssi.php'); You're including the parent file in itself. This could be the problem. c. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] include() problems
-- snip -- From: Chris W. Parker [EMAIL PROTECTED] The address is: http://mydomain.com/forums/ssi.php?a=active The code I'm trying now is: $_GET['a'] = 'active'; include('forums/ssi.php'); You're including the parent file in itself. This could be the problem. --SNIP -- especially if the ssi.php is not a class -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] include () problems
If you are having a problem that tells you that output was displayed on a given line in a given file. And you found this because after the output you tried sending headers, then look in that file on that given line, and you will see the problem. It could be a simple as a ? ? type break in your code. If that doesn't work, start by removing all the code in that file and adding it back peice by peice up until you have your error message. Then you will know what is causing the problem. Jim Lucas - Original Message - From: Mjec [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, August 25, 2003 12:56 AM Subject: [PHP] include () problems Hi, When I run the line: include (fnord.php); with the file looking like: ?php define (fnord_included, true); function fnord ($arg = true) { // 450 lines return $msg; } ? it prints out the return of fnord() (i.e. $msg). I've checked, and there's no echo or print statemetns anywhere... Oh, yeah, FYI, the pattern goes like this: file: index.php ?php include (standard.php); /* rest of page */ ? file: standard.php ?php /* a few defines */ include(fnord.php); /* rest of stuff */ header (Content-type: text/html; encoding=utf-8); ? and it prints it right up the top of index.php, causing an error with the header statement (although it says the error is in fnord.php - which contains NO header statemtns). ideas? Regards, mjec -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include Problems
hi eric, as far as i can see, there is no definition for your '$subnav' in your 'incHeader.php'. if you call your main script like this: 'http://example.com/index.php?subnav=home;', this should work with your inclusion. ciao SVEN Eric Fleming wrote: Here is a snippet from the header file. You can see that I am just trying to determine what the value of the subnav variable is set to in order to determine which navigational link is bold. There are other places the variable is used, but you can get an idea based on what is below. Thanks for any help. -incHeader.php-- html head title[Site Name]/title /head body table cellpadding=0 cellspacing=0 border=0 align=left tr td ? if($subnav == home){ ?b? }?a href=index.phphome/a? if($subnav == home){ ?b? }? /td /tr /table -incHeader.php-- Jennifer Goodie [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Without seeing what you have in your includes, it will be hard to determine where your scope is messed up. ?php $subnav = home; include(incHeader.php); !--- CONTENT AREA --- The content would go here. !--- END CONTENT AREA --- ?php include (incFooter.php); ? Now, when I try to reference the subnav variable in the inHeader.php or incFooter.php files, it comes up blank. I am basically trying to adjust the navigation on each page depending on the page I am on. I am just learning PHP, have programmed in ColdFusion for years and in ColdFusion this was not a problem. Any ideas? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include Problems
On Jul 24, 2003, Eric Fleming claimed that: |I am having some problems using variables in included files. Can someone |please look at my code below and see how I might accomplish what I am trying |to do? [snip] |Now, when I try to reference the subnav variable in the inHeader.php or |incFooter.php files, it comes up blank. I am basically trying to adjust the |navigation on each page depending on the page I am on. I am just learning |PHP, have programmed in ColdFusion for years and in ColdFusion this was not |a problem. Any ideas? | |Eric Fleming | http://www.php.net/language.variables.scope Jeff Harris -- Registered Linux user #304026. lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import Key fingerprint = 52FC 20BD 025A 8C13 5FC6 68C6 9CF9 46C2 B089 0FED Responses to this message should conform to RFC 1855. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Include Problems
[snip] ?php $subnav = home; include(incHeader.php); ? !--- CONTENT AREA --- The content would go here. !--- END CONTENT AREA --- ?php include (incFooter.php); ? Now, when I try to reference the subnav variable in the inHeader.php or incFooter.php files, it comes up blank. I am basically trying to adjust the navigation on each page depending on the page I am on. I am just learning PHP, have programmed in ColdFusion for years and in ColdFusion this was not a problem. Any ideas? [/snip] Can we see the incHeader.php and the incFooter.php code? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Include Problems
Without seeing what you have in your includes, it will be hard to determine where your scope is messed up. ?php $subnav = home; include(incHeader.php); ? !--- CONTENT AREA --- The content would go here. !--- END CONTENT AREA --- ?php include (incFooter.php); ? Now, when I try to reference the subnav variable in the inHeader.php or incFooter.php files, it comes up blank. I am basically trying to adjust the navigation on each page depending on the page I am on. I am just learning PHP, have programmed in ColdFusion for years and in ColdFusion this was not a problem. Any ideas? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include Problems
Is the code you are trying to call $subnav from inside a function? If so you will need to tell the function that by using the global keyword (i.e. global $subnav;). Other than that the code you've shown looks right to me. Jason On Thu, 2003-07-24 at 13:55, Eric Fleming wrote: I am having some problems using variables in included files. Can someone please look at my code below and see how I might accomplish what I am trying to do? ?php $subnav = home; include(incHeader.php); ? !--- CONTENT AREA --- The content would go here. !--- END CONTENT AREA --- ?php include (incFooter.php); ? Now, when I try to reference the subnav variable in the inHeader.php or incFooter.php files, it comes up blank. I am basically trying to adjust the navigation on each page depending on the page I am on. I am just learning PHP, have programmed in ColdFusion for years and in ColdFusion this was not a problem. Any ideas? Eric Fleming -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include Problems
Here is a snippet from the header file. You can see that I am just trying to determine what the value of the subnav variable is set to in order to determine which navigational link is bold. There are other places the variable is used, but you can get an idea based on what is below. Thanks for any help. -incHeader.php-- html head title[Site Name]/title /head body table cellpadding=0 cellspacing=0 border=0 align=left tr td ? if($subnav = home){ ?b? }?a href=index.phphome/a? if($subnav = home){ ?b? }? /td /tr /table -incHeader.php-- Jay Blanchard [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] [snip] ?php $subnav = home; include(incHeader.php); ? !--- CONTENT AREA --- The content would go here. !--- END CONTENT AREA --- ?php include (incFooter.php); ? Now, when I try to reference the subnav variable in the inHeader.php or incFooter.php files, it comes up blank. I am basically trying to adjust the navigation on each page depending on the page I am on. I am just learning PHP, have programmed in ColdFusion for years and in ColdFusion this was not a problem. Any ideas? [/snip] Can we see the incHeader.php and the incFooter.php code? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include Problems
Eric, If you want to check to see if $subnav is equal to home you want to use == and not =. Perhaps this is your problem. Jason On Thu, 2003-07-24 at 15:35, Eric Fleming wrote: Here is a snippet from the header file. You can see that I am just trying to determine what the value of the subnav variable is set to in order to determine which navigational link is bold. There are other places the variable is used, but you can get an idea based on what is below. Thanks for any help. -incHeader.php-- html head title[Site Name]/title /head body table cellpadding=0 cellspacing=0 border=0 align=left tr td ? if($subnav = home){ ?b? }?a href=index.phphome/a? if($subnav = home){ ?b? }? /td /tr /table -incHeader.php-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include Problems
Yeah, that is a problem, but I can't even print out the value of the subnav variable. It prints nothing when I try to print the variable. Jason Giangrande [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Eric, If you want to check to see if $subnav is equal to home you want to use == and not =. Perhaps this is your problem. Jason On Thu, 2003-07-24 at 15:35, Eric Fleming wrote: Here is a snippet from the header file. You can see that I am just trying to determine what the value of the subnav variable is set to in order to determine which navigational link is bold. There are other places the variable is used, but you can get an idea based on what is below. Thanks for any help. -incHeader.php-- html head title[Site Name]/title /head body table cellpadding=0 cellspacing=0 border=0 align=left tr td ? if($subnav = home){ ?b? }?a href=index.phphome/a? if($subnav = home){ ?b? }? /td /tr /table -incHeader.php-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include Problems
Here is a snippet from the header file. You can see that I am just trying to determine what the value of the subnav variable is set to in order to determine which navigational link is bold. There are other places the variable is used, but you can get an idea based on what is below. Thanks for any help. -incHeader.php-- html head title[Site Name]/title /head body table cellpadding=0 cellspacing=0 border=0 align=left tr td ? if($subnav == home){ ?b? }?a href=index.phphome/a? if($subnav == home){ ?b? }? /td /tr /table -incHeader.php-- Jennifer Goodie [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Without seeing what you have in your includes, it will be hard to determine where your scope is messed up. ?php $subnav = home; include(incHeader.php); ? !--- CONTENT AREA --- The content would go here. !--- END CONTENT AREA --- ?php include (incFooter.php); ? Now, when I try to reference the subnav variable in the inHeader.php or incFooter.php files, it comes up blank. I am basically trying to adjust the navigation on each page depending on the page I am on. I am just learning PHP, have programmed in ColdFusion for years and in ColdFusion this was not a problem. Any ideas? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Include Problems
[snip] -incHeader.php-- html head title[Site Name]/title /head body table cellpadding=0 cellspacing=0 border=0 align=left tr td ? if($subnav == home){ ?b? }?a href=index.phphome/a? if($subnav == home){ ?b? }? /td /tr /table -incHeader.php-- [/snip] ?php if($subnav == home){ print(stronga href=\index.php\home/a/strong); } ? HTH! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include Problems
What is different about the code that you wrote except that you have the html being output by php? Jay Blanchard [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] [snip] -incHeader.php-- html head title[Site Name]/title /head body table cellpadding=0 cellspacing=0 border=0 align=left tr td ? if($subnav == home){ ?b? }?a href=index.phphome/a? if($subnav == home){ ?b? }? /td /tr /table -incHeader.php-- [/snip] ?php if($subnav == home){ print(stronga href=\index.php\home/a/strong); } ? HTH! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include Problems
Eric, I tried your code on my machine and it seems to print the name of the variable just fine. The only change I had to make to your code was add the long PHP tags (i.e. ?php instead of ?) since I have short tags disabled. Here's the header as I ran it. !--###-- html head title[Site Name]/title /head body table cellpadding=0 cellspacing=0 border=0 align=left tr td ?php echo $subnav ? ?php if($subnav == home){ ?b?php }? a href=index.phphome/a ?php if($subnav == home){ ?/b?php }? /td /tr /table !---- It printed home twice once bolded and as a link. I don't think the problem is your code maybe some weird php.ini setting is set, as to which one however I couldn't say. Jason On Thu, 2003-07-24 at 15:44, Eric Fleming wrote: Yeah, that is a problem, but I can't even print out the value of the subnav variable. It prints nothing when I try to print the variable. Jason Giangrande [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Eric, If you want to check to see if $subnav is equal to home you want to use == and not =. Perhaps this is your problem. Jason On Thu, 2003-07-24 at 15:35, Eric Fleming wrote: Here is a snippet from the header file. You can see that I am just trying to determine what the value of the subnav variable is set to in order to determine which navigational link is bold. There are other places the variable is used, but you can get an idea based on what is below. Thanks for any help. -incHeader.php-- html head title[Site Name]/title /head body table cellpadding=0 cellspacing=0 border=0 align=left tr td ? if($subnav = home){ ?b? }?a href=index.phphome/a? if($subnav = home){ ?b? }? /td /tr /table -incHeader.php-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include Problems
I have ran it on my local machine and at my hosting company and it doesn't work for me. I even tried using ?php instaed of ? Jason Giangrande [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Eric, I tried your code on my machine and it seems to print the name of the variable just fine. The only change I had to make to your code was add the long PHP tags (i.e. ?php instead of ?) since I have short tags disabled. Here's the header as I ran it. !--###-- html head title[Site Name]/title /head body table cellpadding=0 cellspacing=0 border=0 align=left tr td ?php echo $subnav ? ?php if($subnav == home){ ?b?php }? a href=index.phphome/a ?php if($subnav == home){ ?/b?php }? /td /tr /table !---- It printed home twice once bolded and as a link. I don't think the problem is your code maybe some weird php.ini setting is set, as to which one however I couldn't say. Jason On Thu, 2003-07-24 at 15:44, Eric Fleming wrote: Yeah, that is a problem, but I can't even print out the value of the subnav variable. It prints nothing when I try to print the variable. Jason Giangrande [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Eric, If you want to check to see if $subnav is equal to home you want to use == and not =. Perhaps this is your problem. Jason On Thu, 2003-07-24 at 15:35, Eric Fleming wrote: Here is a snippet from the header file. You can see that I am just trying to determine what the value of the subnav variable is set to in order to determine which navigational link is bold. There are other places the variable is used, but you can get an idea based on what is below. Thanks for any help. -incHeader.php-- html head title[Site Name]/title /head body table cellpadding=0 cellspacing=0 border=0 align=left tr td ? if($subnav = home){ ?b? }?a href=index.phphome/a? if($subnav = home){ ?b? }? /td /tr /table -incHeader.php-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Include Problems
[snip] What is different about the code that you wrote except that you have the html being output by php? [/snip] I just cleaned it up some, used non deprecated formatting tags and sis it all in one shot. HTH -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Include Problems
Jay Blanchard mailto:[EMAIL PROTECTED] on Thursday, July 24, 2003 1:12 PM said: I just cleaned it up some, used non deprecated formatting tags and sis it all in one shot. Yeah but Jay, you didn't allow for an else. Your code should have an else in there so that even if he's not at home it'll still print the link, just not bold. ;) Also, a ternary operator would be best for this. echo ($subnav == home) ? stronga...Home/a/strong : a...Home/a; Chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include Problems
I figured out what was wrong with it, thanks for all your help. I hate syntax errors. I needed to echo the variable when trying to display it and the double = helped resolve the other problem. Thanks everyone. Chris W. Parker [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Jay Blanchard mailto:[EMAIL PROTECTED] on Thursday, July 24, 2003 1:12 PM said: I just cleaned it up some, used non deprecated formatting tags and sis it all in one shot. Yeah but Jay, you didn't allow for an else. Your code should have an else in there so that even if he's not at home it'll still print the link, just not bold. ;) Also, a ternary operator would be best for this. echo ($subnav == home) ? stronga...Home/a/strong : a...Home/a; Chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include() problems IGNORE PARENT
Never mind. Apparently I can't tell the difference between a capital and a lowercase B. time to crash methinks. leo On February 13, 2003 11:59 pm, Leo Spalteholz wrote: I just ran into a somewhat strange problem with an include failing. I have the following in my script: include(dirname(__FILE__)./LNScreens/LNScrMain.php); include(dirname(__FILE__)./LNDataBase/LNDataBase.php); The first file is included just fine, but the LNDataBase file fails (Failed opening for inclusion). My directory structure is: /LNDataBase LNDataBase.php /LNScreens LNScrMain.php index.php The file exists and it seems to be the exact same syntax as what I used to include the other file. What else could possibly be wrong? Thanks for any help, Leo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Include Problems
Isnt this supposed to be a friendly place where people who are having problem with PHP can ask questions without people like u throwing insults? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 26, 2002 12:47 PM To: Mike Bowers Subject: Re: [PHP] Include Problems Learn to quote GAMER - Original Message - From: Mike Bowers mailto:[EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, December 26, 2002 8:42 PM Subject: [PHP] Include Problems I have a file named header.php stored in the includes folder: Inside includes is anohter folder called editable. When I open my page for the first time (before it is cached) or after I edit my header file I get these errors: Warning: Failed opening 'editable/meta.php' for inclusion (include_path='') in /home/groups/v/vw/vwportal/htdocs/includes/header.php on line 52 Warning: Failed opening 'javascript.php' for inclusion (include_path='') in /home/groups/v/vw/vwportal/htdocs/includes/header.php on line 53 Warning: Failed opening 'editable/my_header.php' for inclusion (include_path='') in /home/groups/v/vw/vwportal/htdocs/includes/header.php on line 56 Is there any other command I can run iside my header.php file instead of include that will print the contents of the includes that the header has? Mike Bowers PlanetModz Gaming Network Webmaster [EMAIL PROTECTED] ViperWeb Hosting Server Manager [EMAIL PROTECTED] [EMAIL PROTECTED] All outgoing messages scanned for viruses using Norton AV 2002
Re: [PHP] Include Problems
Post the include statements from your header.php file. Mike Bowers wrote: Isnt this supposed to be a friendly place where people who are having problem with PHP can ask questions without people like u throwing insults? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 26, 2002 12:47 PM To: Mike Bowers Subject: Re: [PHP] Include Problems Learn to quote GAMER - Original Message - From: Mike Bowers mailto:[EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, December 26, 2002 8:42 PM Subject: [PHP] Include Problems I have a file named header.php stored in the includes folder: Inside includes is anohter folder called editable. When I open my page for the first time (before it is cached) or after I edit my header file I get these errors: Warning: Failed opening 'editable/meta.php' for inclusion (include_path='') in /home/groups/v/vw/vwportal/htdocs/includes/header.php on line 52 Warning: Failed opening 'javascript.php' for inclusion (include_path='') in /home/groups/v/vw/vwportal/htdocs/includes/header.php on line 53 Warning: Failed opening 'editable/my_header.php' for inclusion (include_path='') in /home/groups/v/vw/vwportal/htdocs/includes/header.php on line 56 Is there any other command I can run iside my header.php file instead of include that will print the contents of the includes that the header has? Mike Bowers PlanetModz Gaming Network Webmaster [EMAIL PROTECTED] ViperWeb Hosting Server Manager [EMAIL PROTECTED] [EMAIL PROTECTED] All outgoing messages scanned for viruses using Norton AV 2002 -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include Problems
A couple of items which will help you get a better / friendlier response here. Don't send mail to the list in HTML format, and don't request a return reciept. HTH Mike Bowers wrote: Isnt this supposed to be a friendly place where people who are having problem with PHP can ask questions without people like u throwing insults? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 26, 2002 12:47 PM To: Mike Bowers Subject: Re: [PHP] Include Problems Learn to quote GAMER - Original Message - From: Mike Bowers mailto:[EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, December 26, 2002 8:42 PM Subject: [PHP] Include Problems I have a file named header.php stored in the includes folder: Inside includes is anohter folder called editable. When I open my page for the first time (before it is cached) or after I edit my header file I get these errors: Warning: Failed opening 'editable/meta.php' for inclusion (include_path='') in /home/groups/v/vw/vwportal/htdocs/includes/header.php on line 52 Warning: Failed opening 'javascript.php' for inclusion (include_path='') in /home/groups/v/vw/vwportal/htdocs/includes/header.php on line 53 Warning: Failed opening 'editable/my_header.php' for inclusion (include_path='') in /home/groups/v/vw/vwportal/htdocs/includes/header.php on line 56 Is there any other command I can run iside my header.php file instead of include that will print the contents of the includes that the header has? Mike Bowers PlanetModz Gaming Network Webmaster [EMAIL PROTECTED] ViperWeb Hosting Server Manager [EMAIL PROTECTED] [EMAIL PROTECTED] All outgoing messages scanned for viruses using Norton AV 2002 -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include Problems
Mike Bowers wrote: I have a file named header.php stored in the includes folder: Inside includes is anohter folder called editable. When I open my page for the first time (before it is cached) or after I edit my header file I get these errors: *Warning*: Failed opening 'editable/meta.php' for inclusion (include_path='') in */home/groups/v/vw/vwportal/htdocs/includes/header.php* on line *52* Perhaps it is a permissions problem, after editing it (as whatever user you use to edit files), is the file readable by the user the webserver runs as? HTH Chris PS I'm sure it would be appreciated if you would be kind enough to post in plain text (not html), someone has to pay for archiving it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Include Problems
It's not permissions. The files to be read as well as folders are all CHMOD 777 as I thought it was this originally. Thanks for your suggestion though. -Original Message- From: Chris Hewitt [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 26, 2002 1:11 PM To: Mike Bowers Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Include Problems Mike Bowers wrote: I have a file named header.php stored in the includes folder: Inside includes is anohter folder called editable. When I open my page for the first time (before it is cached) or after I edit my header file I get these errors: *Warning*: Failed opening 'editable/meta.php' for inclusion (include_path='') in */home/groups/v/vw/vwportal/htdocs/includes/header.php* on line *52* Perhaps it is a permissions problem, after editing it (as whatever user you use to edit files), is the file readable by the user the webserver runs as? HTH Chris PS I'm sure it would be appreciated if you would be kind enough to post in plain text (not html), someone has to pay for archiving it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include Problems
You can try setting your include path in a .htaccess file in your web root, like this php_value include_path .:/path/to/include/directory Mike Bowers wrote: The includes are as follows: Include(editable/meta.php); Include(javascript.php); Include(editable/my_header.php); -Original Message- From: John Nichel [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 26, 2002 12:58 PM To: Mike Bowers Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Include Problems Post the include statements from your header.php file. Mike Bowers wrote: Isnt this supposed to be a friendly place where people who are having problem with PHP can ask questions without people like u throwing insults? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 26, 2002 12:47 PM To: Mike Bowers Subject: Re: [PHP] Include Problems Learn to quote GAMER - Original Message - From: Mike Bowers mailto:[EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, December 26, 2002 8:42 PM Subject: [PHP] Include Problems I have a file named header.php stored in the includes folder: Inside includes is anohter folder called editable. When I open my page for the first time (before it is cached) or after I edit my header file I get these errors: Warning: Failed opening 'editable/meta.php' for inclusion (include_path='') in /home/groups/v/vw/vwportal/htdocs/includes/header.php on line 52 Warning: Failed opening 'javascript.php' for inclusion (include_path='') in /home/groups/v/vw/vwportal/htdocs/includes/header.php on line 53 Warning: Failed opening 'editable/my_header.php' for inclusion (include_path='') in /home/groups/v/vw/vwportal/htdocs/includes/header.php on line 56 Is there any other command I can run iside my header.php file instead of include that will print the contents of the includes that the header has? Mike Bowers PlanetModz Gaming Network Webmaster [EMAIL PROTECTED] ViperWeb Hosting Server Manager [EMAIL PROTECTED] [EMAIL PROTECTED] All outgoing messages scanned for viruses using Norton AV 2002 -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include Problems
On Thu, 26 Dec 2002, Mike Bowers wrote: I have a file named header.php stored in the includes folder: Inside includes is anohter folder called editable. When I open my page for the first time (before it is cached) or after I edit my header file I get these errors: Warning: Failed opening 'editable/meta.php' for inclusion (include_path='') in Your include_path in php.ini is null, as indicated by the line above. What you're assuming will happen is that include will automatically look in the includes dir for files, so you have to set this: include_path=./includes I set mine: include_path = .:./:../:./include:../include g.luck, ~Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Include Problems
This has worked. Thanks for your inout and help everybody. -Original Message- From: John Nichel [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 26, 2002 1:13 PM To: Mike Bowers; [EMAIL PROTECTED] Subject: Re: [PHP] Include Problems You can try setting your include path in a .htaccess file in your web root, like this php_value include_path .:/path/to/include/directory Mike Bowers wrote: The includes are as follows: Include(editable/meta.php); Include(javascript.php); Include(editable/my_header.php); -Original Message- From: John Nichel [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 26, 2002 12:58 PM To: Mike Bowers Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Include Problems Post the include statements from your header.php file. Mike Bowers wrote: Isnt this supposed to be a friendly place where people who are having problem with PHP can ask questions without people like u throwing insults? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 26, 2002 12:47 PM To: Mike Bowers Subject: Re: [PHP] Include Problems Learn to quote GAMER - Original Message - From: Mike Bowers mailto:[EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, December 26, 2002 8:42 PM Subject: [PHP] Include Problems I have a file named header.php stored in the includes folder: Inside includes is anohter folder called editable. When I open my page for the first time (before it is cached) or after I edit my header file I get these errors: Warning: Failed opening 'editable/meta.php' for inclusion (include_path='') in /home/groups/v/vw/vwportal/htdocs/includes/header.php on line 52 Warning: Failed opening 'javascript.php' for inclusion (include_path='') in /home/groups/v/vw/vwportal/htdocs/includes/header.php on line 53 Warning: Failed opening 'editable/my_header.php' for inclusion (include_path='') in /home/groups/v/vw/vwportal/htdocs/includes/header.php on line 56 Is there any other command I can run iside my header.php file instead of include that will print the contents of the includes that the header has? Mike Bowers PlanetModz Gaming Network Webmaster [EMAIL PROTECTED] ViperWeb Hosting Server Manager [EMAIL PROTECTED] [EMAIL PROTECTED] All outgoing messages scanned for viruses using Norton AV 2002 -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include Problems
On Thursday 26 December 2002 12:06 pm, Mike Bowers wrote: It's not permissions. The files to be read as well as folders are all CHMOD 777 as I thought it was this originally. don't use 777. that makes the scripts writeable for everyone. any other user who can run scripts on that server can delete those scripts or replace them with something malicious. if any scripts on that server can be tricked into executing code as the webserver user (nobody, apache, www, whatever) then those files of yours can also be modified. you're probably just testing on a private server, in which case 777 is convenient (still a bad habit, but convenient). but remember to fix the permissions when you upload to a real server. better yet, switch to saner permissions even if only testing on a private server. *Warning*: Failed opening 'editable/meta.php' for inclusion (include_path='') in */home/groups/v/vw/vwportal/htdocs/includes/header.php* on line *52* looks like include_path in your php.ini is empty. if you have: ?php phpinfo(); ? what does the include_path section say? normally, you should have entries in there corresponding to directories where include files can be found. e.g., a good minimal include_path might be: include_path=.:..:/var/lib/www/standard_php_includes or something similar (i made up the last part, replace with wherever you put standard includes that you use). i like having the current directory and .. in there for obvious reasons. tiger -- Gerald Timothy Quimpo tiger*quimpo*org gquimpo*sni-inc.com tiger*sni*ph Public Key: gpg --keyserver pgp.mit.edu --recv-keys 672F4C78 Veritas liberabit vos. Doveryai no proveryai. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Include problems
include 'inc/test.inc' will work fine if you add your root directory to your include_path (in the c:\winnt\php.ini file). Daniel Kushner [EMAIL PROTECTED] Need hosting? http://www.TheHostingCompany.us/ -Original Message- From: Scott [mailto:[EMAIL PROTECTED]] Sent: Saturday, August 03, 2002 3:11 PM To: [EMAIL PROTECTED] Subject: [PHP] Include problems I have PHP4 on both a windows IIS server and a windows apache server. The include function only works in the same directory of the file I wish to access. ex. www.include.com/default.php all files in same directory (i guess the root)? ?php include 'test.inc' ? everything works fine. Here's where I have the problem. Now I want to store all my includes in one directory www.include.com/inc ?php include 'inc/test.inc' ? that doesn't work Warning: Failed opening 'test.inc' for inclusion (include_path='') Can anyone help me with this??? Thanks scott -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include problems
Does this mean i have to do this to each site??? Daniel Kushner [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... include 'inc/test.inc' will work fine if you add your root directory to your include_path (in the c:\winnt\php.ini file). Daniel Kushner [EMAIL PROTECTED] Need hosting? http://www.TheHostingCompany.us/ -Original Message- From: Scott [mailto:[EMAIL PROTECTED]] Sent: Saturday, August 03, 2002 3:11 PM To: [EMAIL PROTECTED] Subject: [PHP] Include problems I have PHP4 on both a windows IIS server and a windows apache server. The include function only works in the same directory of the file I wish to access. ex. www.include.com/default.php all files in same directory (i guess the root)? ?php include 'test.inc' ? everything works fine. Here's where I have the problem. Now I want to store all my includes in one directory www.include.com/inc ?php include 'inc/test.inc' ? that doesn't work Warning: Failed opening 'test.inc' for inclusion (include_path='') Can anyone help me with this??? Thanks scott -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include problems
does the require has something to be with include ? Cause instead of using include im always usin require Thanks, Flavio Bastos Amiel Scott [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Does this mean i have to do this to each site??? Daniel Kushner [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... include 'inc/test.inc' will work fine if you add your root directory to your include_path (in the c:\winnt\php.ini file). Daniel Kushner [EMAIL PROTECTED] Need hosting? http://www.TheHostingCompany.us/ -Original Message- From: Scott [mailto:[EMAIL PROTECTED]] Sent: Saturday, August 03, 2002 3:11 PM To: [EMAIL PROTECTED] Subject: [PHP] Include problems I have PHP4 on both a windows IIS server and a windows apache server. The include function only works in the same directory of the file I wish to access. ex. www.include.com/default.php all files in same directory (i guess the root)? ?php include 'test.inc' ? everything works fine. Here's where I have the problem. Now I want to store all my includes in one directory www.include.com/inc ?php include 'inc/test.inc' ? that doesn't work Warning: Failed opening 'test.inc' for inclusion (include_path='') Can anyone help me with this??? Thanks scott -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Include problems
Include and require are identical, except for their failure behavior - require() halts permanently ending execution of the script. Sincerely, Maxim Maletsky PHP Beginner www.phpbeginner.com -Original Message- From: ::: Flavio Bastos Amiel:: [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 04, 2002 12:53 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Include problems does the require has something to be with include ? Cause instead of using include im always usin require Thanks, Flavio Bastos Amiel Scott [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Does this mean i have to do this to each site??? Daniel Kushner [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... include 'inc/test.inc' will work fine if you add your root directory to your include_path (in the c:\winnt\php.ini file). Daniel Kushner [EMAIL PROTECTED] Need hosting? http://www.TheHostingCompany.us/ -Original Message- From: Scott [mailto:[EMAIL PROTECTED]] Sent: Saturday, August 03, 2002 3:11 PM To: [EMAIL PROTECTED] Subject: [PHP] Include problems I have PHP4 on both a windows IIS server and a windows apache server. The include function only works in the same directory of the file I wish to access. ex. www.include.com/default.php all files in same directory (i guess the root)? ?php include 'test.inc' ? everything works fine. Here's where I have the problem. Now I want to store all my includes in one directory www.include.com/inc ?php include 'inc/test.inc' ? that doesn't work Warning: Failed opening 'test.inc' for inclusion (include_path='') Can anyone help me with this??? Thanks scott -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include problems
Thanks Maxim, it is good to know! :) Flavio Bastos Amiel Maxim Maletsky [EMAIL PROTECTED] wrote in message 000401c23b48$55266960$1113fe17@dominanta">news:000401c23b48$55266960$1113fe17@dominanta... Include and require are identical, except for their failure behavior - require() halts permanently ending execution of the script. Sincerely, Maxim Maletsky PHP Beginner www.phpbeginner.com -Original Message- From: ::: Flavio Bastos Amiel:: [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 04, 2002 12:53 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Include problems does the require has something to be with include ? Cause instead of using include im always usin require Thanks, Flavio Bastos Amiel Scott [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Does this mean i have to do this to each site??? Daniel Kushner [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... include 'inc/test.inc' will work fine if you add your root directory to your include_path (in the c:\winnt\php.ini file). Daniel Kushner [EMAIL PROTECTED] Need hosting? http://www.TheHostingCompany.us/ -Original Message- From: Scott [mailto:[EMAIL PROTECTED]] Sent: Saturday, August 03, 2002 3:11 PM To: [EMAIL PROTECTED] Subject: [PHP] Include problems I have PHP4 on both a windows IIS server and a windows apache server. The include function only works in the same directory of the file I wish to access. ex. www.include.com/default.php all files in same directory (i guess the root)? ?php include 'test.inc' ? everything works fine. Here's where I have the problem. Now I want to store all my includes in one directory www.include.com/inc ?php include 'inc/test.inc' ? that doesn't work Warning: Failed opening 'test.inc' for inclusion (include_path='') Can anyone help me with this??? Thanks scott -- 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