turbopowerdmaxsteel
Mar 13 2007, 07:29 PM
As per the php documentation:- CODE // Won't work; looks for a file named 'file.php?foo=1&bar=2' on the // local filesystem. include 'file.php?foo=1&bar=2';
// Works. include 'http://www.example.com/file.php?foo=1&bar=2'; So, I used the following code to include the header.php file which I use to draw the top navigation menu on my site. CODE <? include "http://" . $_SERVER['HTTP_HOST'] . "/includes/header.php?d=../../" ?> It worked before, but now I see the following errors on my page. QUOTE Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/ntek/public_html/products/pikabot/index.php on line 31
Warning: include(http://ntek.astahost.com/includes/header.php?d=../../) [function.include]: failed to open stream: no suitable wrapper could be found in /home/ntek/public_html/products/pikabot/index.php on line 31
Warning: include() [function.include]: Failed opening 'http://ntek.astahost.com/includes/header.php?d=../../' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/ntek/public_html/products/pikabot/index.php on line 31
I suppose disabling URL file access was meant for security purposes. Is there any workaround?
Reply
pyost
Mar 13 2007, 11:03 PM
Correct me if I am wrong, but you want to include a PHP file that will, depending on the d parameter, display some data. Instead of including a file along with the parameter (header.php?d=value), all you need to is execute include('header.php');, while having the value assigned to a certain variable. A bit confusing? Maybe. Here's how the code would look: CODE <?php // Some PHP code $d = value; include('header.php'); //More PHP code ?> Since include means copying one file's contents to the current page, you would be able to use $d in header.php instead of $_GET['d']. That's at least how I do it.
Reply
vujsa
Mar 14 2007, 12:24 AM
I'm not entirely sure that I understand you issue since what you are talking about doesn't really make any sense to me.  If you include a file, you include ALL of it's contents into the script requesting it! So, $foo and $bar don't need to be passed in the url!, you can set them as normal! header.php: CODE <?php if(isset($foo) && isset($bar)){ $foobar = $foo + $bar; echo $foobar; } else{ echo "You forgot to set Foo and Bar"; } ?> index.php: CODE <?php $foo = 2; $bar = 3; include('header.php'); ?> I think a better option for you would be to create a function for your header area! For best results, you should place all of your functions in a single include file and then call the functions as needed! I will be happy to discuss this further in the PHP forums! As it is, I really don't see that the server should be reconfigured to allow your method of file inclusion. There is a work around available for your issue at php.net if you wish to continue with this method of coding! vujsa
Reply
turbopowerdmaxsteel
Mar 14 2007, 04:46 AM
QUOTE(pyost @ Mar 14 2007, 04:33 AM)  Correct me if I am wrong, but you want to include a PHP file that will, depending on the d parameter, display some data. Instead of including a file along with the parameter (header.php?d=value), all you need to is execute include('header.php');, while having the value assigned to a certain variable. A bit confusing? Maybe. Here's how the code would look: CODE <?php // Some PHP code $d = value; include('header.php'); //More PHP code ?> Since include means copying one file's contents to the current page, you would be able to use $d in header.php instead of $_GET['d']. That's at least how I do it. Sorry for the unclear clarification. I thought the example ought to make it clear. Anyways, what you've said is exactly what I want to do. I had no idea that variables are passed across files in such a fashion. Kinda, overrides the variable scope thingy we learn in the other programming languages, doesn't it? I was aware that such a thing could be done in the same file but still couldn't guess this comming. QUOTE(vujsa @ Mar 14 2007, 05:54 AM)  I'm not entirely sure that I understand you issue since what you are talking about doesn't really make any sense to me.  If you include a file, you include ALL of it's contents into the script requesting it! So, $foo and $bar don't need to be passed in the url!, you can set them as normal! header.php: CODE <?php if(isset($foo) && isset($bar)){ $foobar = $foo + $bar; echo $foobar; } else{ echo "You forgot to set Foo and Bar"; } ?> index.php: CODE <?php $foo = 2; $bar = 3; include('header.php'); ?> I think a better option for you would be to create a function for your header area! For best results, you should place all of your functions in a single include file and then call the functions as needed! I will be happy to discuss this further in the PHP forums! As it is, I really don't see that the server should be reconfigured to allow your method of file inclusion. There is a work around available for your issue at php.net if you wish to continue with this method of coding! vujsa My appologies to you too. I prefer to have different header files, more so because they contain a lot of plain HTML codes and having to resort to echo is really trecherous. I wouldn't ask for server re-configuration either, just something that does the job. Thank You guys, you were of tremendous help.
Reply
Quatrux
Mar 14 2007, 06:25 AM
You don't really need to resort your html code to echo or print if you program in a "good' way, here is an example how you can do it: CODE <?php
function print_header($array = NULL) {
?>
<html> ... This is my HEADER!
<?php }
# parse my Header print_header();
?> Furthermore, about the remote including, as Astahost is running on PHP5 now, there is a new option in the settings which doesn't exist on PHP4, even though allow_url_fopen is On by default on Astahost, the new setting allow_url_include is Off, and this is logical, a lot of people needs to open remote files and they don't want to have the inclusion for remote files, also this setting adds more security, due to there are a lot of novice php programmers, which lets their site include remote files through the get method, with this setting this will be impossible to do, they will get an error and no php code could be executed! It is recommended only to read the remote files and not to include anything.
Reply
pyost
Mar 14 2007, 09:38 AM
QUOTE(Quatrux @ Mar 14 2007, 07:25 AM)  You don't really need to resort your html code to echo or print if you program in a "good' way, here is an example how you can do it: You can do this in another way, which doesn't require opening PHP code (again) when you want to inserta variable: CODE <?php // PHP code
$titleVariable = 'Untitled document';
$html = <<<EOF
<!-- Here you would put pure HTML code, but would also be able to add variable -->
<html> <head> <title> $titleVariable </title> </head> </html>
EOF;
echo $html; ?>
Reply
vujsa
Mar 14 2007, 06:13 PM
Well, from a hosting support point of view, this issue has been resolved. Closing topic. Please feel free to discuss it further in the PHP forum! vujsa
Reply
iGuest
Mar 24 2008, 10:45 PM
Replying to vujsaeasy add this line to "/php-bin/your php.Ini": Allow_url_include = On Best regardz --- -reply by vodafogne
Reply
Recent Queries:--
url file configuration - 1.54 hr back. (1)
-
cpanel url file-access is disabled in the server configuration - 5.22 hr back. (1)
-
php5 url file-access is disabled - 13.44 hr back. (1)
-
[function.include]: url file-access is disabled in the server configuration - 18.47 hr back. (1)
-
html:: access a link to file on a server - 19.14 hr back. (1)
-
url file-access is disabled in the server configuration in - 1.10 hr back. (5)
-
"url file-access is disabled in the server configuration" - 20.31 hr back. (1)
-
url file-access cpanel - 22.26 hr back. (1)
-
getimagesize(): url file-access is disabled in the server configuration in (removed server info).php - 22.66 hr back. (3)
-
url file-access is disabled in the server configuration - 3.38 hr back. (10)
-
url file-access is disabled in the server config - 23.84 hr back. (1)
-
warning: include() [function.include]: url file-access is disabled in the server configuration - 25.06 hr back. (1)
-
set url file access php - 29.14 hr back. (1)
-
php url access - 30.24 hr back. (2)
Similar Topics
Keywords : url, file, access, disabled, server, configuration
- Server Status Page Gone
(1)
File Types
What File Type are allowed (7) Hi, can I know what file types are allowed because the FAQ is down. I need the .htc .sh for ADR
RPG Mod for phpBB. xxxx-jozh-xxxx PS: If all are allowed, just say all file types allowed,
don't stress yourself by typing every file type!....
123flashchat Server
Startup Problem (0) I have been encountering several problems while attempting to use the 123FlashChat Server on my
hosting account here at Astahost. (www.123flashchat.com) I tried to start the server by passing a
command via the SSH Telnet utility on port 22, and received the following error- QUOTE
omkar@gamma # ./fcserver.sh start Starting server ...... omkar@gamma # Error occurred during
initialization of VM Could not reserve enough space for object heap I request Admins to look
into the matter and respond to me. I need to start this service to my visitors as soon as p....
AW Stats: Love em! Can't access them :(
Love em! Can't access them! (4) Hi Guys, New to hosting here and SO HAPPY especially to see that you have AWStats. Had them at my
old host and they are terrific! Can't believe how many features are offered here for FREE
hosting /smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />
However, I didn't have to configure my AWSTATS at my old host so I don't know how. When I
try to access the stats, I get the following error message: QUOTE Error: Couldn't open
config file "awstats.welcometothefair.com.conf" nor "awstats.conf" after searching in pa....
File Size Limits?
Issue with SWF Files (2) I didn't see anything in the FAQ or with the search about filesizes, so I'll ask about it
here: I have a radio.blog (for those of you who don't know what that is, it's a flash
player that converts MP3 files into SWF's for faster streaming) and it's been acting up
lately. I asked for help on the RB support forums, and someone suggested that it could be my
host's filesize limit or non-permittance of certain filetypes. So my question is this - How big
is too big for Astahost, and is there a problem with hosting SWF files? I'd say that most ....
Cant Access My Account
(1) ve uploaded all the files via FTP to my site but for some reason whever I try to view the pages in a
browser it simply comes up with an error message. The only page I can get is the defaul AstaHost
page you get when you first goto your site and havent made a new website to take its place? My url
is: http://tazum.astaplace.com I should have a page at: http://tazum.astaplace.com/index.php
But it wont work? I simply get this error message: Not Found The requested URL /index.php was not
found on this server. Additionally, a 404 Not Found error was encountered whil....
Is There Anyway To Get Telnet Access?
(3) Is There Anyway To Get Telnet Access? Here is another crazy request. I would like to run the
Entropy Search index builder every couple of days or so. Is there any way to schedule this as a
CRON job?....
Ssh Access - Could I Get It Back
(0) I posted this to the requests forum a while ago but nothing happened... So I though to try here. I
can't log on using SSH, so could I get it back enabled. I need SSH access for SCP file
transfers. I'm FTPhobic.....
Are Server Changes Being Made?
(2) This afternoon I entered my site and got an SQL error, so I went to the cPanel and the phpMyAdmin is
now green (it used to be blue). One of my tables could not be repaired so I dropped it then I
recreated it and refilled from my backup copy, but I contined to have the same problem, so I dropped
all the tables and did a reinstall. Now it is working again but there is one problem, When using the
Firefox with the forums I get a prompt to enter data instead of just bolding or underlining or
really anything like code or quote, and it will only take a limited amout of data int....
Server Issues Again?
(2) Anyone else having problems with having credit days and yet they can't access their site? Mine
was fine til a couple minutes ago....another server hiccup, I guess.....
Public Access To Subdirs In Public_html
what is the security? (7) I know that subdirectories in public_html are accessible to the public on the web if you know their
name (the name of the subdirectory). The question is whether there is any easy way to get at them
if you do not know their name. Files in these subdirectories are conveniently accessible to you on
the web, but how secure are they? Do web crawlers find them and make them accessible to a search
even if they contain no html files?....
Need Help With Music File
need help on getting music file to work (11) I was wondering if anyone can please help me with uploading a music file. I got my first hosting
package and logged in without a problem. So when i'm in my cpanel account I went under the
section "Site management tools" then to "file manager" Then on the file manager I uploaded a music
file. so now, i clicked on properties and then found the URL and when i tried playing the music
file on another site, i cant hear any music?? is their some other step i need to do? or did i do
something wrong??....
Get Server Timeout Error Msg
i try to update my site with frontpage (0)
Is There A Max File Size Limit When Uploading?
(4) I just tried uploading a 23 MB .wmp file. It started to upload but then after about 6 minutes a box
popped up in the corner. It said "Page Cannot Be Displayed" so I tryed it again assuming there was
an error, but I got the same thing. So I'm wondering if there is a file size limit or if there
are file types that are restricted. I couldn't find this information anywhere else so I'd
appreciate someone letting me know.....
Installing Programs On The Server Via Cpanel
(2) Hi I was wondering if I could install php applications on the Cpanel? SDK....
Another e-mail question
pop 3 access (7) Hi, I'm still trying to find out how I can get e-mail through my pop3 email client. Where can I
find the pop3 server addr, smpt server addr and why not imap server addr. Please help me...:-)
Brgds Jens....
cpanel help file
(0) hi, i'm not sure where to post this, but the cPanel theme is missing a link to the help file.
The help file is located at http://stickboarder.info:2082/docs/cpanel/index.html or
http://astahost.com:2082/docs/cpanel/index.html For everyone that doesn't understand cPanel,
the help file is REALLY handy....
Looking for url, file, access, disabled, server, configuration
|
|
Searching Video's for url, file, access, disabled, server, configuration
|
advertisement
|
|