| | |
Help with .inc files!!
![]() |
•
•
Join Date: Feb 2008
Posts: 2
Reputation:
Solved Threads: 0
Hi All,
Please bare with me as I'm new to this forum and to web design. I was asked by my boss to design adn upload a new website via ftp, which I can do. I realised this morning that it is not as simple as just that! Basically, here's what I need help with..
When I access our URL this is what I get
Warning: include(includes/globals.php.inc) [function.include]: failed to open stream: No such file or directory in /home/planlond/public_html/index.php on line 5
Warning: include() [function.include]: Failed opening 'includes/globals.php.inc' for inclusion (include_path='.:/usr/lib/php') in /home/planlond/public_html/index.php on line 5
Warning: include(includes/functions.php) [function.include]: failed to open stream: No such file or directory in /home/planlond/public_html/index.php on line 6
Warning: include() [function.include]: Failed opening 'includes/functions.php' for inclusion (include_path='.:/usr/lib/php') in /home/planlond/public_html/index.php on line 6
Warning: include(lang/.php) [function.include]: failed to open stream: No such file or directory in /home/planlond/public_html/index.php on line 7
Warning: include() [function.include]: Failed opening 'lang/.php' for inclusion (include_path='.:/usr/lib/php') in /home/planlond/public_html/index.php on line 7
Warning: include(themes//config.php.inc) [function.include]: failed to open stream: No such file or directory in /home/planlond/public_html/index.php on line 8
Warning: include() [function.include]: Failed opening 'themes//config.php.inc' for inclusion (include_path='.:/usr/lib/php') in /home/planlond/public_html/index.php on line 8
Warning: include(themes//homepage.php) [function.include]: failed to open stream: No such file or directory in /home/planlond/public_html/index.php on line 16
Warning: include() [function.include]: Failed opening 'themes//homepage.php' for inclusion (include_path='.:/usr/lib/php') in /home/planlond/public_html/index.php on line 16
I know that it's because I havn't done something with the .inc file, but to be honest I'm, a bit clueless in regard to all this....a simple design and upload it is not!! I'm using Dreamweaver.
HELP!!
Thank you for your time!
Beks XX
Please bare with me as I'm new to this forum and to web design. I was asked by my boss to design adn upload a new website via ftp, which I can do. I realised this morning that it is not as simple as just that! Basically, here's what I need help with..
When I access our URL this is what I get
Warning: include(includes/globals.php.inc) [function.include]: failed to open stream: No such file or directory in /home/planlond/public_html/index.php on line 5
Warning: include() [function.include]: Failed opening 'includes/globals.php.inc' for inclusion (include_path='.:/usr/lib/php') in /home/planlond/public_html/index.php on line 5
Warning: include(includes/functions.php) [function.include]: failed to open stream: No such file or directory in /home/planlond/public_html/index.php on line 6
Warning: include() [function.include]: Failed opening 'includes/functions.php' for inclusion (include_path='.:/usr/lib/php') in /home/planlond/public_html/index.php on line 6
Warning: include(lang/.php) [function.include]: failed to open stream: No such file or directory in /home/planlond/public_html/index.php on line 7
Warning: include() [function.include]: Failed opening 'lang/.php' for inclusion (include_path='.:/usr/lib/php') in /home/planlond/public_html/index.php on line 7
Warning: include(themes//config.php.inc) [function.include]: failed to open stream: No such file or directory in /home/planlond/public_html/index.php on line 8
Warning: include() [function.include]: Failed opening 'themes//config.php.inc' for inclusion (include_path='.:/usr/lib/php') in /home/planlond/public_html/index.php on line 8
Warning: include(themes//homepage.php) [function.include]: failed to open stream: No such file or directory in /home/planlond/public_html/index.php on line 16
Warning: include() [function.include]: Failed opening 'themes//homepage.php' for inclusion (include_path='.:/usr/lib/php') in /home/planlond/public_html/index.php on line 16
I know that it's because I havn't done something with the .inc file, but to be honest I'm, a bit clueless in regard to all this....a simple design and upload it is not!! I'm using Dreamweaver.
HELP!!
Thank you for your time!
Beks XX
Check where include directory is. If you are executing a script in, say for example, www/site/test/1.php and you are trying to include a file eg. functions.php, which is in www/site/include folder, you should give,
include ("../include/functions.php"); because that's where the file is. If you give, include ("include/functions.php"); it wont be able to find it, hence, you get this error. Ignorance is definitely not bliss!
*PM asking for help will be ignored*
*PM asking for help will be ignored*
eg.
The basic idea is, if(1!=2) will always return true. So, it will include error.php (where you can have a message saying the site is down or something). Make required changes in the path of all other include files and then remove the condition 1!=2.
php Syntax (Toggle Plain Text)
if(1!=2){ include "error.php"; } else { include "includes/function.php"; include "includes/anotherpage.php"; ........ }
Ignorance is definitely not bliss!
*PM asking for help will be ignored*
*PM asking for help will be ignored*
•
•
Join Date: Jan 2008
Posts: 57
Reputation:
Solved Threads: 5
•
•
•
•
That's great, thankyou (although still having great difficulty!!) Sorry to be a pain, but is there a quick simple way I can display a static page on the URL whilst I figure this out? My boss isn't too pleased.. oops
Thankyou!
First thing you'll want to do (at least when you're not testing it) is turn off error-reporting.
This will prevent the errors from showing up and telling your users that something is broke. You can do this by adding this line to the top of the file.
php Syntax (Toggle Plain Text)
ini_set("display_errors", "Off");
Then, you can add a conditional statement to check if the file was included or not. If include() successfully finds the file, it returns "True." Otherwise, it will return false.
Seeing as you're including a lot of files, I'd create an error flag, set that flag to "True" if any of the files aren't included, and then at the end of the includes check whether or not the flag was set. Like this...
php Syntax (Toggle Plain Text)
$error = false; if ( !include("exampleFile.php")) { // There was an error, exampleFile.php wasn't found $error = true; } if ( !include("exampleFile2.php")) { // There was an error, exampleFile2.php wasn't found $error = true; } if ($error == true) { // There was an error // Include your alternate info here // Or use header("Location: http://domain.com/static-page.html"); to redirect } else { // There was on error. Execute the regular page here. }
Or... you could just rename the file you're working with to something else. Then create a new file with the old name (and no includes). Once you've fixed the original file, change the names back.
Good luck,
- Walkere
![]() |
Similar Threads
- "Save Target As.." isn't working in IE6 (Web Browsers)
- hjsplit doenst work for avi files? (Windows NT / 2000 / XP)
- Does Samba send deleted files to a recycle bin? (*nix Software)
- problems wid cpp files (C++)
- Dia, .PDB files (C++)
- Cannot transfer files from one hardrive to another =[ please help (Windows NT / 2000 / XP)
- FTP files (Geeks' Lounge)
Other Threads in the PHP Forum
- Previous Thread: How to Make search page and code
- Next Thread: Multi-Lingual Site
Views: 825 | Replies: 4
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache array box broken buttons cakephp cart check checkbox class cms code database date development directory display download dropdown drupal dynamic echo email error file files folder form forms function functions header hosting href htaccess html image include insert ip java javascript joomla jquery limit link login loop mail menu mlm mod_rewrite multiple mysql order parse password paypal php post problem query radio recursion redirect regex remote rewrite script search select server session sort sorting source sql storage string structure system table tutorial unicode update updates upload url user validation variable video web website wordpress xml zend






