Page 3 of 3 FirstFirst 123
Results 21 to 27 of 27

Thread: phpInclude Help

  1. #21
    Join Date
    Nov 2006
    Location
    D?sseldorf
    Posts
    2,858
    Tokens
    2,256

    Latest Awards:

    Default

    Right. I don't really want to change the script, because, it also sets the title of the box

    PHP Code:
    ontenttitle" class="title">
               <?php
               
               
    if(!$_GET['page']) {
              echo 
    "WELCOME TO JETENGLAND!";
               }
               elseif(
    $_GET['page']) {
                   if(
    $_GET['subpage']) {
                       
    $page_name str_replace("_"" "$_GET['page']);
                       
    $subpage_name str_replace("_"" ",$_GET['subpage']);
                   echo 
    strtoupper($page_name." - ".$subpage_name);
                   }
                   elseif(!
    $_GET['subpage']) {
                       if(
    $_GET['page'] == "ADMINISTRATIONCENTRE")
                       {
                            echo 
    strtoupper("ADMINISTRATION CENTRE");
                       }
                       else
                       {
                       echo 
    strtoupper($_GET['page']);
                       }
                   }
               }
              
    ?>
    So, instead of getting rid of this, how could i use .htaccess so /page/$1/$2 = ?page=$1&subpage=$2
    I tried it, but it wouldn't work :/

    Luke

  2. #22
    Join Date
    Oct 2006
    Location
    Peterborough, UK
    Posts
    3,855
    Tokens
    216

    Latest Awards:

    Default

    Quote Originally Posted by Apolva View Post
    While it may stop you leaving your /www/ dir, you can still read "secret" files used by other scripts, plus files which usually need .htaccess authentication.
    That's a design error, you shouldn't include protected files in a directory with dynamic inputs.


    visit my internet web site on the internet
    http://dong.engineer/
    it is just videos by bill wurtz videos you have been warned

  3. #23
    Join Date
    Apr 2010
    Location
    Newcastle
    Posts
    655
    Tokens
    50

    Default

    Quote Originally Posted by Jewish Bear View Post
    That's a design error, you shouldn't include protected files in a directory with dynamic inputs.
    @Jwish Bear - What I'm saying is, /protected/ could be accessed through the exploit when it would usually require some kind of authentication.
    Better to just fix the script, rather than relying on a safety net.

    @LukeBateson, look into mod_rewrite here. Some knowledge of regular expressions might come in handy.
    Last edited by Apolva; 05-05-2010 at 07:48 PM.

  4. #24
    Join Date
    Dec 2006
    Location
    Swindon
    Posts
    3,299
    Tokens
    215
    Habbo
    dunko

    Latest Awards:

    Default

    Just ignore my working script then :S?

  5. #25
    Join Date
    Nov 2006
    Location
    D?sseldorf
    Posts
    2,858
    Tokens
    2,256

    Latest Awards:

    Default

    Quote Originally Posted by Blob View Post
    Just ignore my working script then :S?
    Sorry Blob, but again, it's because of the title defining i prefer the "page" "subpage" script. Didn't mean to ignore it

  6. #26
    Join Date
    Nov 2008
    Location
    Cambridge, UK
    Posts
    901
    Tokens
    100

    Default

    Quote Originally Posted by Jewish Bear View Post
    That's a design error, you shouldn't include protected files in a directory with dynamic inputs.
    Stop arguing for the sake of arguing. The point is, it could (easily) be exploited, so why take the risk? It's quick and easy to make it secure, so there is no reason what so ever for not doing it.
    we're smiling but we're close to tears, even after all these years

  7. #27
    Join Date
    Oct 2006
    Location
    Peterborough, UK
    Posts
    3,855
    Tokens
    216

    Latest Awards:

    Default

    if you're really that paranoid, use this:

    PHP Code:
    $page preg_replace'#([^a-zA-Z0-9_-]+)#'''$_GET'page' ] ); 


    visit my internet web site on the internet
    http://dong.engineer/
    it is just videos by bill wurtz videos you have been warned

Page 3 of 3 FirstFirst 123

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •