PDA

View Full Version : PHP error problem


Shadow Demon
08-23-2002, 04:38 AM
Ok this is my page right here http://www.xenogames.host.sk/saiyin...?page=main.html as u can see this error on my page right in the middle is bugging me. I cant get it 2 work. It suppose 2 show my updates and stuff like that. Can n e one help me PLEASE!!! Thanks

codewarrior
08-23-2002, 04:39 AM
You are not authorized to view this page
You might not have permission to view this directory or page using the credentials you supplied.
:rolleyes:

Shadow Demon
08-23-2002, 04:43 AM
what???? Are u trying 2 say that I can't use php or something. Well that can't b because i just changed my layout and the php didnt work. I must have deleted something by mistake but dont know what it is...

codewarrior
08-23-2002, 04:46 AM
LOL ... When I click on the link you posted its says what I posted earlier. :D

stuntboy
08-23-2002, 04:48 AM
I doubt it is nt being allowed to use php. the link was not a good one the forum looks to shorten the links and when I clicked the link that is waht the brower literally went to for me.

what error is reported and what is your code is the best way to handle it as we cannot see your php from the client side only the error message

Shadow Demon
08-23-2002, 04:48 AM
o sorry about that. the url is

http://www.xenogames.host.sk/saiyinblood

just enter the site and u will see it. It might load a little slow cuz im

codewarrior
08-23-2002, 04:56 AM
Still no cigar bro!

Shadow Demon
08-23-2002, 05:57 AM
ok lets try this again (damn ftp)

http://www.xenogames.host.sk/saiyinblood/index.html

it should work now. sorry about this

codewarrior
08-23-2002, 06:11 AM
Ok I see the errors now!

Warning: Unable to access .html in /mnt/host-users/xenogames/saiyinblood/menu_sb.php on line 403
Warning: Failed opening '.html' for inclusion (include_path='.:/usr/local/lib/php') in /mnt/host-users/xenogames/saiyinblood/menu_sb.php on line 403

codewarrior
08-23-2002, 06:13 AM
Look like a pathing error to me ... But since I'm a n00b :D I would wait till someone diagnoses it properly. Can you post the code where these errors are pointing to??? :thumbsup:

stuntboy
08-23-2002, 06:29 AM
It looks like the variable page is blank. I am betting you have an include statement something like:

<?php
include($page.'.html');
?>

you can try using $_GET['page'] instead (man it is my solution to everything tonight)

<?php
include($_GET['page'].'html');
?>

Shadow Demon
08-23-2002, 06:46 AM
<div style="position: absolute; top: 10px; left: 173px; width: 450px;">
<!-- News - Content - Updates-->
<?php
include($_GET['menu_sb'].'html');
?>
<!-- News - Content - Updates End-->
</div>
</BODY>

</HTML>

This is part of the problem right here. This is where everything goes wrong. It still won't work.

mordred
08-23-2002, 09:33 AM
Then you have to use the right link to this page. It must contain the filename minus the ".html" as a GET parameter, so if you want to include menu.html, you call that page in a link like

http://blabla.com/dir/page.php?menu_sb=menu

Shadow Demon
08-23-2002, 10:29 AM
ERRRRR!!!! Its still not working... :(:(

mordred
08-23-2002, 10:54 AM
*What* exactly is not working?

Remember, people can give you only then descriptive help if you post an elaborate error description.

"I cannot stress this enough. We cannot possibly help you if you simply post a thread, copy and paste your whole script and say "it has errors what's wrong with it?". Keep this in mind:

1. Explain to us what your script does (or what it's supposed to do).

2. Explain to us what exactly the error is. Is it a PHP error? Your own error reporting? MySQL error? Or is it just not doing what you want?

3. Remember that you know a lot more about your script than we do. Don't assume we know just what it does."

taken from
http://forums.devshed.com/showthread.php?threadid=24097

Shadow Demon
08-23-2002, 11:40 AM
ohh thanks for pointing that out for me. Sorry for all the confusing. OK

this script that I am using puts My Layout and all the links on every page on my site. All i have to do is put the content on a blank page (using no html or with my layout) and it will shows with the layout. so its like

My Layout + Black page with words on it = Layout with Content on it.

Ok thats the script part.

Now i think I must have erased something to get this error code that says



code:--------------------------------------------------------------------------------Warning: Unable to access .html in /mnt/host-users/xenogames/saiyinblood/menu_sb.php on line 403--------------------------------------------------------------------------------


code:--------------------------------------------------------------------------------Warning: Failed opening '.html' for inclusion (include_path='.:/usr/local/lib/php') in /mnt/host-users/xenogames/saiyinblood/menu_sb.php on line 403--------------------------------------------------------------------------------


but i cant seem to find it out. So the problem is that I can't get my content to show up. Thats why that eror keeps popping up. I hope this cleared up a lot of stuff and thanks again mordred for pointing that out. Also here is a link to my php file so u guys can veiw the sources.

http://www.xenogames.host.sk/saiyinblood/menu_sb.php (this should work) Thank you

mordred
08-23-2002, 11:56 AM
When I open the page you linked like

http://www.xenogames.host.sk/saiyinblood/menu_sb.php?page=main.

it seems to work for me (I see a list of posts).

So the trouble seems to lie in the dot between the filename and it's extension, if you're using this code:

<?php
include($_GET['menu_sb'] . 'html');
?>

Perhaps you better change it to

<?php
include($_GET['menu_sb'] . '.html');
?>

and then you only have to pass the filename. If you want to work with complet filenames (+extension), as indicated in your navigation links, you can do

<?php
include($_GET['page']);
?>

Note: Including a file based on GET parameters without a previous check for correct data is considered a security issue. Do *always* make sure that the incoming data corresponds to your expectations.

Shadow Demon
08-23-2002, 12:14 PM
ok the first one i did said the same thing. i tried the 2nd one and this error came up

Warning: Failed opening '' for inclusion (include_path='.:/usr/local/lib/php') in /mnt/host-users/xenogames/saiyinblood/menu_sb.php on line 403


now what???

mordred
08-23-2002, 12:23 PM
I have no idea which code you used and which URL you tried. :rolleyes: