Jump to content

hugh90

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

hugh90's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I was wondering if you can use dynamic inclusion with files outside the index directory. If so, how? For example: My index.php is in public_html and I want to access my dog.php page that is in the directory “animals” http://www.site.com/index.php?page=dog Where at in the URL would I include the directory "animals"? Thanks
  2. [quote author=redarrow link=topic=104064.msg414926#msg414926 date=1155463136] [code] <?php if($_GET['cmd']=="file"){ what ever you want to do with the match from the link }else{ echo " sorry your link did not match this condition"; } ?> [/code] [/quote] Do I just straight replace the above code with my code below? [code] <?php If(file_exists($_GET['id'].".php")) {include($_GET['id'].".php");} else {include("homepage.php");} ?> [/code] Sorry my understanding of php is non-existent :(
  3. Hi, I’m very bad at php and I need your expertise please. Example, this is how my files are linked. >> www.site.com/?id=file/file/page This is a very bad linking system and so inflexible, it only works as long as pages are literally the same as the above example URL is. But if I were to install a php script (formmail script, quiz scripts, etc..) basically anything that requires submission, a link to be pressed, scripts that require .include codes' to be placed in my php pages, then it doesn’t work and goes back to homepage.php (as specified in the code below). I’m guessing this happens because the link by those php scripts generate a link/url to a requested file (that even already exists and should link it) but fails to work since it only reads url’s that are coded as the above example. I also think the php coding below is also to blame, for some reason it thinks the whole php scripting/linking world revolves around URL’s that are linked such as the above example. This is what I have in the index.php page where I want the dynamic pages to show: <?php If(file_exists($_GET['id'].".php")) {include($_GET['id'].".php");} else {include("homepage.php");} ?> Please fix the above code (or do anything) so that it is more flexible.  ??? Thank you.
  4. [quote author=corbin link=topic=103870.msg414015#msg414015 date=1155317250] I would make directory listings unavailable where it would generate uhhh 403 (?) errors... then you could just use an appropriate error document... Possibly having it redirct the user to /index [/quote] Yeah but how would I do this? I don't know, can you please explain how to do this?
  5. Hi thanks i've added it, and it works but it just shows the same Directory Listing but without my raw files (which is a good thing)  But it looks very unprofessional, so how can I completely stop the Directory Listing page from showing, hopfully with an error page or a redirect back to the main page. Can this be achieved through .htaccess?
  6. [quote author=mainewoods link=topic=103870.msg413950#msg413950 date=1155311340] just add a file called index.htm to that directory and then it will just show that file and that file can have a meta-refresh in it to go elsewhere. [/quote] So that means adding an index.htm manually in every folder/directory? Isn't there a way that can stop this at once? A quick fix code or the way to url my php’s so that it is permanently stable without manually adding an index.htm with every folder. Thank you
  7. My site is in .php How do you stop from raw files showing? The files of my site show up if I (for example) go to www.site.com/folder/folder. How do I prevent this situation so the raw files doesn't show up? Most sites when you go to www.site.com/folder/folder you end up on a normal webpage, but mine shows the raw files. :( Some sites stop this from happening to their site and protect it, can you please tell me how to stop it too? I'm a newbie. :| Thanks :)
×
×
  • Create New...

Important Information

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.