Welcome Guest ( Log In | Register)



2 Pages V  < 1 2  
Reply to this topicStart new topic
> .php?id=html Not Working
jlhaslip
post 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 Icon

Group: [MODERATOR]
Posts: 3,971
Joined: 24-July 05
From: In Trouble Again... still?
Member No.: 9,787
Spam Patrol



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... smile.gif
Go to the top of the page
 
+Quote Post
reith
post 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 >_>
Go to the top of the page
 
+Quote Post
truefusion
post Nov 2 2007, 05:11 AM
Post #13


Ephesians 6:10-17
Group Icon

Group: [MODERATOR]
Posts: 1,893
Joined: 22-June 05
From: The World of Gentoo
Member No.: 8,528
T17 GFX Crew



QUOTE(reith @ Nov 2 2007, 01:03 AM) *
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.
Go to the top of the page
 
+Quote Post
jlhaslip
post 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 Icon

Group: [MODERATOR]
Posts: 3,971
Joined: 24-July 05
From: In Trouble Again... still?
Member No.: 9,787
Spam Patrol



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)")
    }

?>
Go to the top of the page
 
+Quote Post
truefusion
post Nov 2 2007, 05:32 AM
Post #15


Ephesians 6:10-17
Group Icon

Group: [MODERATOR]
Posts: 1,893
Joined: 22-June 05
From: The World of Gentoo
Member No.: 8,528
T17 GFX Crew



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!).
Go to the top of the page
 
+Quote Post
dave2win
post 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.

Notice from rvalkass:

Merged double posts. Remember you can use the Edit button to add to your post if no-one else has replied.
Go to the top of the page
 
+Quote Post

2 Pages V  < 1 2
Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Html Tag For A Code Box(4)
  2. My File Manager Is Working(2)
  3. Problems With Outlook Express(6)
  4. Html To Php Convertor?(12)
  5. My Feedback Php Module Isnt Working...(2)
  6. Is The Report Function Working?(3)
  7. Help My Forum Connection Isn't Working(4)
  8. Site Not Working!(7)
  9. Smtp Server Is Not Working...?(4)
  10. Web Mail Forwarding Not Working?(0)
  11. Making Custom Error Pages With Cpanel(4)
  12. I Have A Question About Where To Put My Html.(6)
  13. Problem With My Hosting [resolved](5)
  14. Toolbar Not Working (adobe Dreamweaver)(7)
  15. D-22 Shoutbox Not Working [resolved](3)
  1. Web/ftp Stats Not Working [resolved](2)
  2. Html Editor Glitch(7)
  3. Awstats Not Working(2)
  4. Bandwidth Counter Not Working(17)
  5. Changes In Phpmyadmin(0)
  6. Have There Been Any Changes?(1)
  7. My Subdomain Not Working(3)
  8. The Cgi Centre In Cpanel Isn't Working!(4)
  9. Www Vs. Public_html [resolved](3)
  10. Css Problem On Website(8)
  11. File Manager Not Working(2)
  12. Backup Not Working [resolved](5)
  13. Gallery Not Working(2)


 



- Lo-Fi Version Time is now: 30th August 2008 - 04:46 PM