|
|
|
|
![]() ![]() |
Nov 2 2007, 03:52 AM
Post
#11
|
|
|
A computer once beat me at chess, but it was no match for me at kick boxing. ![]() Group: [MODERATOR] Posts: 3,971 Joined: 24-July 05 From: In Trouble Again... still? Member No.: 9,787 ![]() |
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... |
|
|
|
Nov 2 2007, 05:03 AM
Post
#12
|
|
|
Newbie [Level 2] ![]() ![]() Group: Members Posts: 35 Joined: 6-September 07 Member No.: 49,507 |
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 >_>
|
|
|
|
Nov 2 2007, 05:11 AM
Post
#13
|
|
|
Ephesians 6:10-17 ![]() Group: [MODERATOR] Posts: 1,893 Joined: 22-June 05 From: The World of Gentoo Member No.: 8,528 ![]() |
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. |
|
|
|
Nov 2 2007, 05:19 AM
Post
#14
|
|
|
A computer once beat me at chess, but it was no match for me at kick boxing. ![]() Group: [MODERATOR] Posts: 3,971 Joined: 24-July 05 From: In Trouble Again... still? Member No.: 9,787 ![]() |
Here is another approach to take
CODE <?php
$id = $_GET['id']; if (file_exists( $id)) { require_once($id); } else { die("unable to open file ($id)") } ?> |
|
|
|
Nov 2 2007, 05:32 AM
Post
#15
|
|
|
Ephesians 6:10-17 ![]() Group: [MODERATOR] Posts: 1,893 Joined: 22-June 05 From: The World of Gentoo Member No.: 8,528 ![]() |
Note: It is more secure if you use this code:
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://www.eternaldiscordrpgs.trap17.com/r...d=reithonry.php (let it load for like 7-10 seconds, and you'll see why—be sure to stop the loading!). |
|
|
|
Apr 8 2008, 03:14 AM
Post
#16
|
|
|
Member [Level 1] ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 65 Joined: 7-April 08 From: Toronto, Canada Member No.: 60,502 |
Hi,
I think that registered globals are not enabled on Trap17 servers so as you are forwarding your page id as GET mathod then you should use superglobal $_GET[]. You can put the variable ($id) within the parenthesis. Like this <?php include($_GET['$id']); ?> I also prefer include_once rather than include. It's just a precausionary measure. You should also use superglobals whereever you wanna refer to data from other page which are forwarded to current scripts. That's better programming. I also add this. You should know your server settings from a phpinfo(); file on your trap17 server and then use them to manually configure your local PHP settings so that what runs on your PC should run similarly on your Trap17 servers, and other than your fiance the rest of the world can enjoy it. |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 30th August 2008 - 04:46 PM |