Jump to content

dreamwest

Members
  • Posts

    1,223
  • Joined

  • Last visited

    Never

Posts posted by dreamwest

  1. Heres another way:

     

    say you have a normal link to download files:

     

    http://site.com/get.php?id=876

     

    function password_gen($min=6,$max=6,$id){ /*has a default min value of 6 and maximum value of 6*/
    $pwd=""; // to store generated password
    for($i=0;$i<rand($min,$max);$i++){
      $num=rand(48,122);
      if(($num >= 97 && $num <= 122))     $pwd.=chr($num);
      else if(($num >= 65 && $num <= 90))  $pwd.=chr($num);
      else if(($num >=48 && $num <= 57))    $pwd.=chr($num);
      else    $i--;
    }
    return "encrypt->".strtoupper($pwd).mt_rand()."l".$id."l".strtoupper($pwd).time();
    }
    $file_id = password_gen(6,6,$row['id']);

     

    As you can see the link will be something like this:

     

    http://site.com/get.php?=encrypt->3EA4VTRM1875445687l876lA4VTRM1252451005

     

    You can see in the center l876l  so in get.php simply explode the "l" to get the id which is 876, because the link is always changing its almost imposible for ppl to run grabbers on your site

     

    Now someone could write a script to simply explode the "l" anyways, so pull the "salt" from a database, update the salt whenver you  like

     

  2. <script>
       function toggleSections(section)
    {
        document.getElementById(section).style.display = "block";
                
        document.remember_page.my_value.value = section;
        document.remember_page.submit();
    
        return false;
    }
    
    function onload_remember_page()
    {
      	// always store the current page on page load
        document.remember_page.my_value.value = "details";
        document.remember_page.submit();
      }
    
    </script>
    <a href="#details" onclick="toggleSections('details_57');return false; " >show</a>
    
    <div id="details_57" style="display: none" >hidden stuff here</div>
    
    

  3. You can grab the URLs with regex:

     

    <?php
    $str = "html here<a class='link' href='http://www.site.com/?q=6J4W2G4fASI'>html here
    html here<a class='link' href='http://www.site.com/?q=637yfuhqelhe'>html here
    html here<a class='link' href='http://www.site.com/?q=hilghye8oyhi'>html here";
    preg_match_all('~<a\b[^>]+href\s?=\s?[\'"](.*?)[\'"]~is', $str, $matches);
    echo '<pre>' . print_r($matches[1], true) . '</pre>';
    ?>

     

    Note that $matches[1] will be an array of the URLs.

     

    Sweet thanks!

     

    I knew preg_match_all would do it but couldnt get my head around the regex

  4. Im trying to break apart a group of hyperlinks so im just left with the actual url:

     

    html here<a class='link' href='http://www.site.com/?q=6J4W2G4fASI'>html here

    html here<a class='link' href='http://www.site.com/?q=637yfuhqelhe'>html here

    html here<a class='link' href='http://www.site.com/?q=hilghye8oyhi'>html here

    etc...

     

    so the result would be :

     

    http://www.site.com/?q=6J4W2G4fASI

    http://www.site.com/?q=637yfuhqelhe

    http://www.site.com/?q=hilghye8oyhi

     

  5. Ok went to youtube with javascript off, tried to watch a vid and:

     

    "Hello, you either have JavaScript turned off or an old version of Adobe's Flash Player. Get the latest Flash player."

     

    Also comments and ratings dont work, related images dont display thumbs, thumbchange doesn work in video section the list goes on.

     

    Verdict: If they dont care neither do i :)

  6. Just of curiosity, does your site function with JS turned off?

     

    Never thought about it....its their fault for not having it on anyway.

     

    WHAT IF they dont anyway, whats the alternative??

     

     

    Google indexing doesn't parse JS either.  So basically go to your site with JS disabled, see how well it works, then think of Google indexing it like that....

     

    Yeah tried it just now most of the site is ok, but features like rating, quicklist and onclick dropdowns etc dont do anything.

     

    BUT when i came back here with javascript off the "insert quote" link didnt work so every site is most likely designed with javascript on by default.

     

    I also checked my logs and less...thats LESS than 1% have javascript turned off.

     

    Im going to add a message in the header to tell ppl they need it on to use the fuctionality of the site

  7. Yeah it is a buffer with a loop, heres the finished script:

     

    Check to make sure proper amount of deliminators "|" in a file

    $handle = @fopen("1.txt", "r");
    
    if ($handle) {
    
    $count = 1;
        
    while (!feof($handle)) {
        
    $buffer = trim(fgets($handle, 10096));
    $check = explode('|', $buffer);
    $check = trim($check[1]);
            
    if ($check == "" || $check == " " ){
    //delete line
        $err .= "ERROR on line {$count} - {$buffer}<br>";
        }else{
        
          //write the rest to a new file
        $current .= $buffer."\n";
        }
    ++$count;
    }
    fclose($handle);
    }
    
    $current = rtrim($current);
    file_put_contents("2.txt", $current);
    

     

     

  8. <IfModule mod_security.c>
    SecFilterEngine Off
    SecFilterScanPOST Off
    </IfModule>
    
    # explicitly disable caching for scripts and other dynamic files
    <FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$">
    Header unset Cache-Control
    </FilesMatch>
    
    # stop ppl from browsing indexes
    Options -Indexes
    
    # disable the server signature
    ServerSignature Off
    
    # prevent folder listing
    IndexIgnore *

  9. You try to avoid Javascript, but use AJAX for everything else? You do realize that AJAX is a Javascript technique, right?

     

    Well my ajax request has about 7 lines of javascript and is 1kb in size, and for what it can do thats impressive - pretty much run the entire sites functionality. Also the fact it can query pages without initially including them is great..I LOV IT!

     

    You want to see javascript overdone get coppermine.....now only 10MB in size .....for what picture galleries and a slideshow

  10. I went from having 10+ second loading times to < 1 second +- 0.5 seconds - thats what gets me excited

     

    after all that your on about speed lol.

     

    Im obsessed with speed! - Crazy obsessed

     

  11. I try to avoid javascript too. I have LESS than 5kb of javascript combined on my entire site (one of the reasons it loads so fast)

     

    I use ajax http request for everything else, its non intrusive and fun to play with and add lots of value to your apps

×
×
  • 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.