Ask a Question related to PHP Programming, Design and Development.
-
Tobias G #1
PHP Includes
Hello,
I am installing coppermine photo gallery on my site. I think I am
running into problems - I get the following error message after
installation
---------
Warning: main(include/config.inc.php): failed to open stream: No such
file or directory in /home/science/www/gallery/include/init.inc.php on
line 125
Fatal error: main(): Failed opening required 'include/config.inc.php'
(include_path='/home/science/inc:') in
/home/science/www/gallery/include/init.inc.php on line 125
---------
Now I think the problem is becuase in my .Htaccess file I specify that
all includes live in /home/science/inc and the include files used by
Coppermine do not live in that folder - they are in
/home/science/www/gallery/include/. How can I continue to use my
existing includes and get Coppermine configured correctly?
And there is a good possibilty that I am completely wrong about the
problem - but the file init.inc.php is in the correct folder and
correctly CHMODed.
Any help would be greatly appreciated
Thanks,
Tobias
Tobias G Guest
-
cf includes
Can someone please help me on this!? Contribute 3.11 claims to protect CF scripts and includes, but users can very easily select and delete the... -
includes
when ever i use the insert include on a site page dreamweaver 8 display view goes funny and does not display the page correctly making it very... -
includes and ASP
I am writing a mail order site using includes and nested includes for ASP code. I have no idea if this is rendered without error in all browsers.... -
Includes Ugh...
Because sometimes people want them to be relative to the calling page. That makes applications more portable to other servers / directory... -
XP includes ???????
ah, ok, thanks -
ConTactMe #2
PHP includes
Is it necessary to have your file named *.php to use PHP code in it, such as
for includes? Can't any extension be used?
Thanks
ConTactMe Guest
-
Joshua Ghiloni #3
Re: PHP includes
ConTactMe wrote:
Any extension can be used. I often use .inc myself.> Is it necessary to have your file named *.php to use PHP code in it, such as
> for includes? Can't any extension be used?
>
> Thanks
>
>
Joshua Ghiloni Guest
-
Gary Petersen #4
Re: PHP includes
On Sun, 14 Sep 2003 22:36:24 -0500, Joshua Ghiloni created an
award-winning crop circle <bk3c48$fji$1@eeyore.INS.cwru.edu>, which, when
translated into English, means this:
But it's safer to use .php because many web servers> ConTactMe wrote:> Any extension can be used. I often use .inc myself.>> Is it necessary to have your file named *.php to use PHP code in it,
>> such as for includes? Can't any extension be used?
>>
>> Thanks
>>
>>
>>
are configured not to process .inc files. If a browser
requests the file, the server will send it in source
code form.
Gary Petersen Guest
-
Bruno Desthuilliers #5
Re: PHP includes
Gary Petersen wrote:
.... Behaviour that you can prevent by using the server's authorization> On Sun, 14 Sep 2003 22:36:24 -0500, Joshua Ghiloni created an
> award-winning crop circle <bk3c48$fji$1@eeyore.INS.cwru.edu>, which, when
> translated into English, means this:
>
>>>>ConTactMe wrote:
>>>>>>>Is it necessary to have your file named *.php to use PHP code in it,
>>>such as for includes? Can't any extension be used?
>>>
>>>Thanks
>>>
>>>
>>>
>>Any extension can be used. I often use .inc myself.
>
> But it's safer to use .php because many web servers
> are configured not to process .inc files. If a browser
> requests the file, the server will send it in source
> code form.
>
mechanism (ie : .htaccess for Apache).
Using .php extensions prevents the server from displaying source code,
but not from executing it, which may not be such a good idea.
Bruno
Bruno Desthuilliers Guest
-
B\(\)_b #6
Re: PHP includes
"Bruno Desthuilliers" <bdesth.nospam@removeme.free.fr> wrote in message
news:3f65d459$0$20617$626a54ce@news.free.fr...when> Gary Petersen wrote:> > On Sun, 14 Sep 2003 22:36:24 -0500, Joshua Ghiloni created an
> > award-winning crop circle <bk3c48$fji$1@eeyore.INS.cwru.edu>, which,I tend to use .inc files in cases where I control the httpd.conf file and> ... Behaviour that you can prevent by using the server's authorization> > translated into English, means this:
> >
> >> >> >>ConTactMe wrote:
> >>
> >>>Is it necessary to have your file named *.php to use PHP code in it,
> >>>such as for includes? Can't any extension be used?
> >>>
> >>>Thanks
> >>>
> >>>
> >>>
> >>
> >>Any extension can be used. I often use .inc myself.
> >
> > But it's safer to use .php because many web servers
> > are configured not to process .inc files. If a browser
> > requests the file, the server will send it in source
> > code form.
> >
> mechanism (ie : .htaccess for Apache).
>
> Using .php extensions prevents the server from displaying source code,
> but not from executing it, which may not be such a good idea.
>
> Bruno
>
can stop these files being displayed.
In the case where you do not control the webserver, a method I have used is
to call my files .ht_php_something
the "dot" ht is generally not output via the webserver - ala .htaccess
..htpasswd
Test it on the server you are using.
The best method of course is to use whatever extension you like and not have
the file in the web server path.
Bob
B\(\)_b Guest
-
ConTactMe #7
Re: PHP includes
Thanks for all the great responses. I was more looking for the naming of the
display file, such as "guestbook.php" vs. "guestbook.html", and was
wondering if you can get the .html file to process PHP code as easily as the
..php file.
"B()_b" <bREMOVEoMEb@norcom.net.au.remove.me> wrote in message
news:1063708240.463309@challenger.norcom.net.au...is>
> "Bruno Desthuilliers" <bdesth.nospam@removeme.free.fr> wrote in message
> news:3f65d459$0$20617$626a54ce@news.free.fr...> when> > Gary Petersen wrote:> > > On Sun, 14 Sep 2003 22:36:24 -0500, Joshua Ghiloni created an
> > > award-winning crop circle <bk3c48$fji$1@eeyore.INS.cwru.edu>, which,>> > ... Behaviour that you can prevent by using the server's authorization> > > translated into English, means this:
> > >
> > >
> > >>ConTactMe wrote:
> > >>
> > >>>Is it necessary to have your file named *.php to use PHP code in it,
> > >>>such as for includes? Can't any extension be used?
> > >>>
> > >>>Thanks
> > >>>
> > >>>
> > >>>
> > >>
> > >>Any extension can be used. I often use .inc myself.
> > >
> > >
> > > But it's safer to use .php because many web servers
> > > are configured not to process .inc files. If a browser
> > > requests the file, the server will send it in source
> > > code form.
> > >
> > mechanism (ie : .htaccess for Apache).
> >
> > Using .php extensions prevents the server from displaying source code,
> > but not from executing it, which may not be such a good idea.
> >
> > Bruno
> >
> I tend to use .inc files in cases where I control the httpd.conf file and
> can stop these files being displayed.
>
> In the case where you do not control the webserver, a method I have usedhave> to call my files .ht_php_something
>
> the "dot" ht is generally not output via the webserver - ala .htaccess
> .htpasswd
>
> Test it on the server you are using.
>
> The best method of course is to use whatever extension you like and not> the file in the web server path.
>
> Bob
>
>
>
ConTactMe Guest
-
Janwillem Borleffs #8
Re: php includes
Moziah wrote:
You are cross-posting (sending the post seperately to multiple newsgroups).> Probably a simpe question with a simple answer. I have a page with a
> menu and an include which contains the content of the page. Is it
> possible to click a link on the menu and have the include bring up a
> different file?
Don't do that. Replied in alt.comp.lang.php.
JW
Janwillem Borleffs Guest
-
Janwillem Borleffs #9
Re: php includes
Janwillem Borleffs wrote:
Sorry, wasn't meant for you. To answer your question, yes it's possible:> Moziah wrote:>>> Probably a simpe question with a simple answer. I have a page with a
>> menu and an include which contains the content of the page. Is it
>> possible to click a link on the menu and have the include bring up a
>> different file?
> You are cross-posting (sending the post seperately to multiple
> newsgroups). Don't do that. Replied in alt.comp.lang.php.
>
When the menu contains a link like:
main.php?main=navigation
The code in main.php might look like this:
<?
$dir = "pages/";
if (isset($_GET['main'])) {
$filename = $dir.$_GET['main'].'php';
if (file_exists($filename)) {
include $filename;
exit;
}
}
include "{$dir}default.php";
?>
HTH,
JW
Janwillem Borleffs Guest
-
Berislav Lopac #10
Re: php includes
Janwillem Borleffs wrote:
Jan, you answered that to two separate posts. Actually, crossposting is OK;> Moziah wrote:>>> Probably a simpe question with a simple answer. I have a page with a
>> menu and an include which contains the content of the page. Is it
>> possible to click a link on the menu and have the include bring up a
>> different file?
> You are cross-posting (sending the post seperately to multiple
> newsgroups). Don't do that. Replied in alt.comp.lang.php.
multiposting is not.
Crossposting means that one message has two or more groups at the header,
and it gets visible in both groups. Multiposting is posting separate
messages, with same contents, on several groups.
Berislav
--
If the Internet is a Marx Brothers movie, and Web, e-mail, and IRC are
Groucho, Chico, and Harpo, then Usenet is Zeppo.
Berislav Lopac Guest
-
Janwillem Borleffs #11
Re: php includes
Berislav Lopac wrote:
I realized that as soon as I pressed the send button. Therefore, I> Jan, you answered that to two separate posts. Actually, crossposting
> is OK; multiposting is not.
>
appologized to the OP of this thread.
JW
Janwillem Borleffs Guest
-
Janwillem Borleffs #12
Re: php includes
Moziah wrote:
No, you only have to change the structure. You will need only 1 main.php,> Would I be right in saying that I would have to write that whoe batch
> of code for every link in the menu?
which can be used to include all existing files.
And, of course, you will have to set up the navigation links.
Security wise, it's recommended to validate each include file to see if it
resides in a specific directory. Otherwise, people would be able to see
files which they shouldn't.
JW
Janwillem Borleffs Guest
-
Moziah #13
Re: php includes
> Moziah wrote:
Here is the code for my page...>>> Would I be right in saying that I would have to write that whoe batch
>> of code for every link in the menu?
> No, you only have to change the structure. You will need only 1
> main.php, which can be used to include all existing files.
>
> And, of course, you will have to set up the navigation links.
>
> Security wise, it's recommended to validate each include file to see
> if it resides in a specific directory. Otherwise, people would be able
> to see files which they shouldn't.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<head>
<title>Softek Designs - Helping your company reach the web</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link href="base.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="sectiont">
<?php include ('content/misc/title.html'); ?>
</div>
<div class="content">
<?php include ('content/central.html'); ?>
</div>
<div class="sectionl">
<a href="index.php">Central</a>
<a href="about.php">About</a>
</div>
</body>
</html>
What do I need to do to get the about section, stored in
content/about.html, to be showed when the about link is clicked on?
Moziah Guest
-
Janwillem Borleffs #14
Re: php includes
Moziah wrote:
<div class="content">> What do I need to do to get the about section, stored in
> content/about.html, to be showed when the about link is clicked on?
<?
if (isset($_GET['page']) &&
file_exists("content/{$_GET['page']}.html")) {
include "content/{$_GET['page']}.html";
} else {
include 'content/central.html';
}
?>
</div>
<div class="sectionl">
<a href="index.php">Central</a>
<a href="index.php?page=about">About</a>
</div>
JW
Janwillem Borleffs Guest
-
Moziah #15
Re: php includes
> Moziah wrote:
That's works great, much appreciated. Thank you!>>> What do I need to do to get the about section, stored in
>> content/about.html, to be showed when the about link is clicked on?
> <div class="content">
> <?
> if (isset($_GET['page']) &&
> file_exists("content/{$_GET['page']}.html")) {
> include "content/{$_GET['page']}.html";
> } else {
> include 'content/central.html';
> }
> ?>
> </div>
>
> <div class="sectionl">
> <a href="index.php">Central</a>
> <a href="index.php?page=about">About</a>
> </div>
>
>
> JW
>
>
>
>
Moziah Guest
-
Wicked43 #16
PHP includes
When I try and edit a page in contribute3 the PHP includes don?t show, they are fine via the browser view. Any ideas anyone please?
Wicked43 Guest
-
mjp420 #17
Re: PHP includes
I feel your pain. I have yet to find a thread that ANSWERS this issue. I
really wish someone form Adobe would address this question...
Why doesn't Contribute display the content of the PHP includes in Edit mode?
Especially when the includes contains the CSS link for the page your editing.
It would be nice to see how the text you edit actually looks. If is isn't
possible, at least just say so. I have yet to see any docs/threads that say it
will work one way or the other. I guess if it doesn't work, i'll just have to
find a different solution that using Contribute.
Thanks for the rant...
-Michael
mjp420 Guest
-
woudesigner #18
Re: PHP includes
I just posted an answer to this same topic here
[url]http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=55&catid=30[/url]
3&threadid=1177131&enterthread=y
We have a solution which may or may not be suitable for every user. Propbably
why Adobe has not used it
Feel free to contact me [email]gilberts@wou.edu[/email]
woudesigner Guest
-
willLanni #19
Re: PHP includes
I am in a similar position. I built the site using PHP to include the head
(with the <html> tag, the <head> tag and its contents, and the opening <body>
tag and the site wide banner), the top nav, and the footer. Very aggravating
that Contribute doesn't render the page when editing the text, nor grab the css
styles.
willLanni Guest
-
anshika012 #20
Re: PHP includes
it's so nice information according to me every one should read it.
Banned
- Join Date
- Nov 2010
- Location
- new delhi
- Posts
- 4



Reply With Quote

