Jump to content
xisto Community
reith

.php?id=html Not Working

Recommended Posts

I use a single php file for all my tag decorations and image calling so that each page is lighter and therefore isn't bogged down with the same repeated code over and over, which allows me not only to much easier change my layout and design (as I often do) but once I've finally gotten it up and working here, I realized none of the links work, I doubled, and triple checked them over and over again to make sure I wasn't making a mistake. I swore Xisto supported php, so why isn't it working? Am I missing some sorta code that i need to add, or need to take away, I'd really hate to have to switch to a much lesser host just because of this, but if the problem cannot be resolved I have no real alternative since all my pages cannot be viewed by clicking the links since all have ".php?id=" references. Any help at all would be immensely beneficial and much appreciated. If by chance somebody knows how to be able to view the same site using a php main file w/ all the tags and decorations, on them on the computer (Vista or XP if it makes a diff, i can use both) I would also be very grateful as it'd allow me an alternative to having to switch to another host and instead just looking at them on my computer, and giving it to my fiance who can look at it on hers (though her only option is XP). I know you can look at plain html files and navigate links that call to your C: locations but using the php?id= didn't work and it would show the cannot find error message in ie and firefox, and windows explorer. Anyways, again thank you very much for any help you may have to offer me, even a definitive answer would be beneficial at this point in time.EDIT: By the way, this is the error message that shows up on the page, rather than any of the text i have for it. "Warning: include() [function.include]: Failed opening '' for inclusion (include_path='.:/usr/lib/http://forums.xisto.com/no_longer_exists/;) in /home/reith/public_html/reithonry.php on line 255" without the quotes. Is there perhaps something wrong with the layout of the folders, and would it at all be alleviated if I deleted all the folders in the ftp upload and just had the main site folder hold everything? The public_html and www folders somewhat confuse me as to why they're there, all hosts that i've had, had a very simplistic folder that you just deleted and made in place what you wanted, and i'm unsure of if placing my files in the public_html folder was right or wrong.

Edited by reith (see edit history)

Share this post


Link to post
Share on other sites

Hey there, assuming this code works on either your local server or another webhost the problem is most likely one of two things. First off you are right in putting your files into the public_html or www folders as these links lead to the only user-viewable directory, so if you have files elsewhere try moving them to a subdirectory of this folder. The other possibility is that your file/folder permissions are set up wrong. For testing purposes try setting permissions to all your files and folders to 777, this is especially true for the files you are using the "include" function on or with. Hopefully this will now work fine, but of curse its insecure so youll have to change the permissions to something like 557 or 556, a little research on google will help with that as i rarely use linux i dont often change file permissions.they are my best suggestions, if the problem persists then post some of the code, especially anywhere where the INCLUDE is used and of course if you havent already then try testing it on another server, it could simply be that the T17 servers are set up differently than the one you are testing on and so a little code modification will solve the issue.

Share this post


Link to post
Share on other sites

Hey there, assuming this code works on either your local server or another webhost the problem is most likely one of two things.
First off you are right in putting your files into the public_html or www folders as these links lead to the only user-viewable directory, so if you have files elsewhere try moving them to a subdirectory of this folder.

The other possibility is that your file/folder permissions are set up wrong. For testing purposes try setting permissions to all your files and folders to 777, this is especially true for the files you are using the "include" function on or with. Hopefully this will now work fine, but of curse its insecure so youll have to change the permissions to something like 557 or 556, a little research on google will help with that as i rarely use linux i dont often change file permissions.

they are my best suggestions, if the problem persists then post some of the code, especially anywhere where the INCLUDE is used and of course if you havent already then try testing it on another server, it could simply be that the T17 servers are set up differently than the one you are testing on and so a little code modification will solve the issue.


I did exactly as you said for changing the file permissions to 777, still no change at all, I applied all changes to the public_html folder (where all my files for the site are) and applied the changes to all files there within so that I would be sure no file was at the default 750 code. I'll post the code I use to make this happen, all other sites have had no problems, I'm not sure why this is being such a big hassle, but thanks for the advice, I really do appreciate any help I can get.

<td valign="top"><?php include ("$id"); ?></td>
The td is just the area I place it so that all other pages fall within that table area, the php include is where I use the tag reference so that I can just type in "reithonry.php?id=file.html" and that file can remain very small and with only the content on it, while the layout is loaded around it via the reithonry file, this has worked on all hosts that have had php enabled, so I'm confused why it's not working here, perhaps I need to use something else, if there is anything that would allow me to keep one file for layout/design and all other files for pure content that goes within a certain area I'd be more than happy to use that instead, as long as it allows pretty much the same and for my other pages to remain clean with just content on them.

Share this post


Link to post
Share on other sites

I think we'll need more code than that.

The public_html Folder is the same as you would have at a 'lesser' Hosting Service as your account root folder. The www Folder is merely an alias Folder of public_html. DO NOT DELETE ANY FILES FROM WWW FOLDER, or they will be gone from the public_html Folder, too. :rolleyes: Learned that the hard way once.

When the php script throws that error, it cannot find the file you requested for the include. There is something wrong with your paths or permissions. You seem to have handled the permissions side, so let's focus on the path..
Post up the php source for the index.php you are using and are all the files in a single folder? public_html? Do you have anything in your .htaccess file that might be affecting the includes? mod_rewrites? Where is the script from? a CMS?
Also, where does the anchor tag get created here:

td valign="top"><?php include ("$id"); ?></td>
There is not an anchor tag here to cause the link to happen, unless the include does that.
What does your source view tell you? are the anchor tags getting created or not?

Share this post


Link to post
Share on other sites

I think we'll need more code than that.
The public_html Folder is the same as you would have at a 'lesser' Hosting Service as your account root folder. The www Folder is merely an alias Folder of public_html. DO NOT DELETE ANY FILES FROM WWW FOLDER, or they will be gone from the public_html Folder, too. :rolleyes: Learned that the hard way once.

When the php script throws that error, it cannot find the file you requested for the include. There is something wrong with your paths or permissions. You seem to have handled the permissions side, so let's focus on the path..
Post up the php source for the index.php you are using and are all the files in a single folder? public_html? Do you have anything in your .htaccess file that might be affecting the includes? mod_rewrites? Where is the script from? a CMS?


All files are in my public_html folder, within sub folders and such related to each thing the php calls for, the main problem isn't that it's just one file or one page that's missing, anything aside from the php file that i use is not working, typing it in or otherwise trying to direct to it won't let me see anything on the page, and i'm 99.999% certain all files are in the proper folders that are needed, though I'll check a few more times just to be sure. I'm not exactly sure what more coding you want, I only have one php file and that's in the main public_html directory, many of the other files are in the same directory with a few exceptions in other folders within the public_html folder, should I put public_html or www folder as extensions in the php link, or is leaving it blank sufficient? Currently a link looks exactly ilke this below.
http://forums.xisto.com/no_longer_exists/

Should it be id=public_html/chapters.html?

Share this post


Link to post
Share on other sites

http://forums.xisto.com/no_longer_exists/
This takes me to a Chat page Log-in screen.
Should it?

http://forums.xisto.com/no_longer_exists/
Should be the link, your link for some reason doesn't show the reithonry.php file which is what i use as my layout and everything, without adding the reithonry.php in there all links head to the chat, not exactly sure why, but try again with that link verbatim and it should show you exactly what I see. Thanks againf or helping jlhaslip, I really do appreciate your assistance. I rechecked the paths again and it seems everything is in order, still unsure of what's wrong, wish I knew how to fix this.

Share this post


Link to post
Share on other sites
codebox bbcode tags _linenums:0'>Post the code from the reithonry.php file inside <strong class='bbc'>codebox </strong>bbcode tags

and do you have an .htaccess file for that account? If so, post it as well.

Share this post


Link to post
Share on other sites

Try this:

<?php $id = $_GET['id'];include ($id);?>
I saw this from the start; you didn't have to provide us with all that code.

 

Note: this simple code is a security flaw.

Share this post


Link to post
Share on other sites

Okay, that looks okay.Sign-in to your account cpanel. When you do that, see if this file is in the very first folder you arrive at. That is the Account Root. The public_html folder is different. Click on the 'folder gif' on the left side of "public_html" to go to the public_html folder. This file should be there, nowhere else, and the includes should also be in that second folder. (public_html)If they are not, they should be moved/copied or re-uploaded. (is that a word?)Man, it would be so much easier if I had your account password, but security is a biggie, so you will have to do this yourself... :rolleyes:

Share this post


Link to post
Share on other sites

Thanks very much for the help, it worked perfectly. If you have a spare moment, do you know exactly why my php include didn't work and the one you used did? Is it because things work better / right with these servers and they didn't on all the other ones I've been on? I'm not entirely sure why the two different codes do the same but one works while the other doesn't. However thank you very much for making it work for me, I greatly appreciate it. And I only put that much code because he said he wanted to see all of the php file >_>

Share this post


Link to post
Share on other sites

Thanks very much for the help, it worked perfectly. If you have a spare moment, do you know exactly why my php include didn't work and the one you used did? Is it because things work better / right with these servers and they didn't on all the other ones I've been on? I'm not entirely sure why the two different codes do the same but one works while the other doesn't. However thank you very much for making it work for me, I greatly appreciate it. And I only put that much code because he said he wanted to see all of the php file >_>

I'm not really sure why your old code would work on the other server and i don't see how it could have, but mine worked because i told the PHP script to place what it gets from the GET method into a variable—the variable you declared. Without it, the script shouldn't (although more like can't) work the way you want it to.

Share this post


Link to post
Share on other sites

Here is another approach to take

<?php$id = $_GET['id'];if (file_exists( $id)) {	require_once($id);} else { 	die("unable to open file ($id)")	}?>

Share this post


Link to post
Share on other sites

Note: It is more secure if you use this code:

<?php$id = $_GET['id'].".html";if (file_exists($id)){include $id;} else {echo "The requested file does not exist.";}?>
That way, you don't have to type in .html at the end of the URL, and just the name of the file instead. Plus, if you use the other code, you'll get the same effect as if you were looking into a mirror that's infront of another mirror if you were to include the same page, example: http://forums.xisto.com/no_longer_exists/ (let it load for like 7-10 seconds, and you'll see why—be sure to stop the loading!).

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.