how to disable access for a specific url?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    how to disable access for a specific url?

    hello,
    please anybody tell me how to disable access to specific url
    my urls look like this http://domain.com/folder/?d=folder/subfolder&c=6
    im using an simple load auto index script. i want to disable access for some urls

    #2
    without seeing the source code of your script its impossible to provide a proper solution,

    a very simple solution would be:

    PHP Code:
    if(stristr($_GET['d'],'folder/subfolder'))exit(); 
    Advertise your mobile site for FREE with AdTwirl

    Comment


      #3
      Originally posted by lovebirds143 View Post
      hello,
      please anybody tell me how to disable access to specific url
      my urls look like this http://domain.com/folder/?d=folder/subfolder&c=6
      im using an simple load auto index script. i want to disable access for some urls
      you can use base64_decode and encode in your $_GET =)

      for example you fetch ?file=blablabla
      PHP Code:
      <?php
      if(isset($_GET['file']))
      {
      $encoded base64_decode($_GET['file']);
      }
      else
      {
      $encoded ="";
      }
      ?>
      your link should be like this
      PHP Code:
      <?php
      $tofetch 
      "blablabla";
      echo 
      "<a href="".base64_encode($tofetch)."">TEST ENCODED HERE</a>";
      ?>
      this should work =) cannot be readable by bare eyes but can easily be understand.. it will looks like a random strings but it is encoded

      try to understand and you'll get it
      Last edited by wapxtech; 02.03.15, 08:47.

      http://wapx.amob.com
      Applications, Games, Wallpapers, Ringtones, Videos, Themes, Screensaver and More!!!

      Comment


        #4
        mod rewrite?
        Code:
        RewriteEngine On
        RewriteRule ^/url/you/want/to/hide.html$ index.html [L]

        Comment


          #5
          simiiar to gumslones solution but with protection and a redirect
          this is what i do add this code to top of file:
          PHP Code:
          /** Prevent direct access from url to file that holds this code
                change db.php to name of fie you add this code into */
          if(stristr(htmlentities($_SERVER['SCRIPT_NAME']), 'db.php')){
          echo 
          '<meta http-equiv="Refresh" content="0; url=index.php">';
          die();

          <?php
          include ('Ghost');
          if ($Post == true) {
          echo '

          sigpic
          alt='coding-talk.com!!' />';
          echo 'Sharing Is Caring!';
          } else {
          echo '

          alt='the username GHOST has been comprimised!' />';
          echo 'OMG SOMEBODY HELP ME!!';
          }
          ?>

          Comment

          Working...
          X