I am currently coding a website and I have a global sidebar. I want every file to have the sidebar and just be able to update my sidebar.php and everything will change, but when I put in
<div><?php include 'sidebar.php'; ?></div>
it doesn't work. I've also tried
<div><?php include 'jophnist.x10.bz/sidebar.php'; ?></div>
Whenever I do that though, it gives me this warning.
Warning: include(): http:// wrapper is disabled in the server configuration by allow_url_include=0 in /home/jophnist/public_html/games/index.php on line 5
Warning: include(http://jophnist.x10.bz/sidebar.php): failed to open stream: no suitable wrapper could be found in /home/jophnist/public_html/games/index.php on line 5
Warning: include(): Failed opening 'http://jophnist.x10.bz/sidebar.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/jophnist/public_html/games/index.php on line 5
What do I do? When I try
<iframe src="http://jophnist.x10.bz/sidebar.php" seamless></iframe>
it works, although it is too small and the words in the file don't go in the sidebar.
I couldn't see your include statement in the question above. But I assume that it's something like:
include('http://jophnist.x10.bz/sidebar.php');
Is that right? If so, instead of passing a url to include, pass a relative path to the sidebar.php file from the current file. If they are in the same directory, use:
include('sidebar.php');
or say for example the files from which you're including sidebar.php are in a subdirectory while sidebar.php is in the main diretory, use:
include('../sidebar.php');
It is possible to pass a url to include in php, if you enable the http file wrapper for includes in php config, but that is very much discouraged since it can cause major security problems.