Jump to content
xisto Community
tracdoor

Php Allow Url Include Question! Need an admin to clarify something...

Recommended Posts

Hi, i've just signed up to your hosting over the last few days, and its been very fustrating that you don't allow the directive: allow_url_include.Do you think that there could be anyway that you could turn it on? i've installed a login and hit counter script and i had to edit half of it.I also want to 'include' my page list on all of my pages, to make it easier to update them, but the only way i would be able to do this is upload a page list to every directory, which defeates the purpose.And i can't use SSI because i can't use PHP with SHTML for some reason.Please help me with a solution, or just turn it on for me ^_^

Share this post


Link to post
Share on other sites

allow_url_include.
Do you think that there could be anyway that you could turn it on? i've installed a login and hit counter script and i had to edit half of it.


This is turned off by server administrators for a reason. To contact further regarding this matter, please visit Xisto - Support.com and submit a support ticket. ^_^

I also want to 'include' my page list on all of my pages, to make it easier to update them, but the only way i would be able to do this is upload a page list to every directory, which defeates the purpose.

You can write a simple script to generate list of pages and dump it as a file. If you are performing a relative directory watch how you are referencing, i.e.
include ../folder/file verses include ./folder/file

Test your script by using a simple include function test.

And i can't use SSI because i can't use PHP with SHTML for some reason.

Has it worked with other web hosting services? Again watch out for proper path, i.e. ../file.ext or ./file.ext

If you can post your partial code perhaps we can figure it out together.

Share this post


Link to post
Share on other sites

Here is the part of the code where i put my SSI in:


<div class="menu"><!--#include virtual="pagelist.html"-->							</div>

Am i doing something wrong? i save it as index.html. If i save it as .shtml the include works, but the php i use for the site login dissapears, so i either manually update every single one of my pages everytime i want to add a link in, or getting rid of my site login.

Is there any comprimise? or am i doing things wrong?

Thanks for any help ^_^

Share this post


Link to post
Share on other sites

Why not save the file as index.php and use a PHP include instead? Isn't allow_url_include for remote files? You shouldn't have a problem using the following code for an extension that can process PHP and if the file is located in the same directory:

<div class="menu"><?php include "pagelist.html"; ?></div>
If i'm not mistaken, on Xisto, index.php has more priority than index.html.

Share this post


Link to post
Share on other sites

I've just done that for all of my pages, now for some reason my page has gone completely messed up when i used the '>' symbol in some of my PHP login code:

Welcome back, <?php echo $qls->user_info['username']; ?>.

It seems that the '>' has been interpreted as the php closing tag for some reason, now my page messes up: http://forums.xisto.com/no_longer_exists/

Any help with this? once thats sorted everything will be fine ^_^

Share this post


Link to post
Share on other sites

That's odd. But it seems like you tried to "short cut" the code; i'm not entirely sure, since i can't see the rest of the code. But rather than placing the PHP ending tag after the left curly bracket, try something like this:

{echo "Welcome back, ".$qls->user_info['username'];}?>
(assuming there's no else.)

Share this post


Link to post
Share on other sites

That's odd. But it seems like you tried to "short cut" the code; i'm not entirely sure, since i can't see the rest of the code. But rather than placing the PHP ending tag after the left curly bracket, try something like this:

{echo "Welcome back, ".$qls->user_info['username'];}?>
(assuming there's no else.)
Here's the full code:

<div class="topbar">There have been <?php include ("counter.php"); ?> hits.<br><?php// Look in the USERGUIDE.html for more infoif ($qls->user_info['username'] != '') {?>Welcome back, <?php echo $qls->user_info['username']; ?>. Click <a href="http://say-help.trap17.com/login/logout.php">here</a> to logout.<br><br>Click <a href="#contactinfo">here</a> to view your contact information.<br><a href="#membersonline">Click here to view the current members online.</a><?php}else {?>Welcome back, please click <a href="http://say-help.trap17.com/login/login.php">here</a> to Login, or <a href="http://say-help.trap17.com/login/register.php/">here</a> to Register.<?php}?>

If its not to much trouble do you think you could sort any problems out? ^_^

I'm downloading a PHP debugger now so hopefully i can work errors out myself now.

Share this post


Link to post
Share on other sites

Try the following and see if it works:

<div class="topbar">There have been <?php include ("counter.php"); ?> hits.<br><?php// Look in the USERGUIDE.html for more infoif ($qls->user_info['username'] != ''){echo "Welcome back, ".$qls->user_info['username'].". Click <a href=\"http://say-help.trap17.com/login/logout.php\">here</a> to logout.<br><br>Click <a href=\"#contactinfo\">here</a> to view your contact information.<br><a href=\"#membersonline\">Click here to view the current members online.</a>";}else {echo "Welcome back, please click <a href=\"http://say-help.trap17.com/login/login.php\">here</a> to Login, or <a href=\"http://say-help.trap17.com/login/register.php/\">here</a> to Register.";}?>

Share this post


Link to post
Share on other sites

Duh, how stupid could i be? i saved it as .html not .php ^_^ Thanks for all your help, one last thing though, can you recommend any free PHP debuggers? i think i'll be needing one :P

Share this post


Link to post
Share on other sites

Thanks for all your help, one last thing though, can you recommend any free PHP debuggers? i think i'll be needing one ^_^

I don't know of any. But i usually just let PHP itself tell me of any errors. There's a PHP function that allows you to modify what errors to output. http://php.net/manual/en/function.error-reporting.php

Share this post


Link to post
Share on other sites

Add these lines to the php code block while Debugging and remove them for a live site:

ini_set("display_errors", 1);error_reporting(E_ALL);
or, wrap it with an IF block and set a variable via a config file to define whether the site is live or not.

$live = 'true';if ( $live == 'true' ) {ini_set("display_errors", 1);error_reporting(E_ALL);}
*untested*

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.