php includes or SSI
php includes or SSI
I have some snippets of code I want use include in certain areas, and I want to use either php includes, or SSI. but no matter what I try and code it with neither one show up.
What and I missing on this?
What and I missing on this?
go on be a devil and give us a little more to go on
can you post the code or a desensitised example of the code?
can you post the code or a desensitised example of the code?
Last edited by pSouper on Fri 30. Apr 2004, 13:50, edited 1 time in total.
-
- Posts: 44
- Joined: Mon 29. Dec 2003, 03:29
Re: php includes or SSI
It is something simple... just recheck the tags and pathing... remember that you have to put the whole path in if you are not keeping the code where Oliver does. I use it all the time... It is a great feature... Here is an exampleeglwolf wrote:I have some snippets of code I want use include in certain areas, and I want to use either php includes, or SSI. but no matter what I try and code it with neither one show up.
What and I missing on this?
Code: Select all
{PHP:/home/stuff/public_html/system/where.php}
if I insert this tag...
in which folder i must put where.php file ??
Code: Select all
{PHP:where.php}
i have included {PHP:my_external.php} in a content;
my_external.php in root dir;
Warning: include_ext_php(my_external.php) [function.include-ext-php]: failed to create stream: No such file or directory in /home/web/www.sporteconomy.it/website/include/inc ... nc.inc.php on line 1062
Warning: include_ext_php() [function.include-ext-php]: Failed opening 'my_external.php' for inclusion (include_path='.:/usr/share/php/PEAR') in /home/web/www.sporteconomy.it/website/include/inc ... nc.inc.php on line 1062
my_external.php in root dir;
Warning: include_ext_php(my_external.php) [function.include-ext-php]: failed to create stream: No such file or directory in /home/web/www.sporteconomy.it/website/include/inc ... nc.inc.php on line 1062
Warning: include_ext_php() [function.include-ext-php]: Failed opening 'my_external.php' for inclusion (include_path='.:/usr/share/php/PEAR') in /home/web/www.sporteconomy.it/website/include/inc ... nc.inc.php on line 1062
I am struggeling with the same problem; I have included a quotes script which should be called from the directory.
I included the above in my template but I get an error saying:
This file is something which is called from the quotation.php file but when pointing my browser to the quotationfile directly, i do not get an error, only when including the file through the template.
any clues/pointers?
Code: Select all
{PHP:/home/.kale/salonphi/salonphilosophique.net/wcms/quotes/quotation.php}
Code: Select all
Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /home/.kale/salonphi/salonphilosophique.net/wcms/quotes/quotation_includes.php on line 30
Error:
any clues/pointers?
Code: Select all
<?php
############################################################################
############################################################################
## ##
## This script is copyright Rupe Parnell (Starsol.co.uk) 2004. ##
## ##
## Distribution of this file, and/or any other files in this package, via ##
## any means, withour prior written consent of the author is prohibited. ##
## ##
## Starsol.co.uk takes no responsibility for any damages caused by the ##
## usage of this script, and does not guarantee compability with all ##
## servers. ##
## ##
## Please use the contact form at ##
## http://www.starsol.co.uk/scripts/contact.php if you need any help or ##
## have any questions about this script. ##
## ##
############################################################################
############################################################################
require ('quotation_includes.php');
connect_to_mysql();
$how_many = mysql_num_rows(mysql_query("SELECT quotation FROM ".$db_prefix."quotations"));
$how_many_minus_one = $how_many - 1;
$random = rand(0,$how_many_minus_one);
$rq = mysql_fetch_array(mysql_query("SELECT quotation FROM ".$db_prefix."quotations LIMIT ".$random.", 1"));
$rq[quotation] = nl2br($rq[quotation]);
mysql_close();
$output = NULL;
$output = "<font style='font-family: ".$font_face."; font-size: ".$font_size."pt; color: ".$font_colour.";'>";
if ($bold){
$output = $output . "<b>";
}
if ($italic){
$output = $output . "<i>";
}
if ($underline){
$output = $output . "<u>";
}
$output = $output . $rq[quotation];
if ($underline){
$output = $output . "</u>";
}
if ($italic){
$output = $output . "</i>";
}
if ($bold){
$output = $output . "</b>";
}
$output = $output . "</font>";
echo $output;
?>