Jump to content

Caesar

Members
  • Posts

    1,025
  • Joined

  • Last visited

    Never

Posts posted by Caesar

  1. Found a random text file on google and tested this simple code...

     

    <?php
    
      $source = file_get_contents('http://www.ccp14.ac.uk/ccp/ccp14/ftp-mirror/nist-texture/test.txt');
      $handle = fopen('logs/log_'.time(), "w"); //Assuming you are saving to a folder 'logs' and that it is set to CHMOD '777'
        	  
      fwrite($handle, $source);
      fclose($handle);
    
    ?>
    
    

  2. Check your if/else statements. They're not structured right.

     

    <?php
    
      if(This is true) {
        // Code here.
      }
    
      elseif(This is true) {
        // Code here.
      }
    
      elseif(This is true) {
        // Code here.
      }
    
        else
        {
           // Code here.
         }
    
    ?>

  3. Or I suppose you can take the reverse approach & compare the user's IP to the IP's in your file....

     

    <?php
    
      $iprange = file_get_contents('ca_ips.txt');
      $userip = $_SERVER['REMOTE_ADDR'];
      $iparray = explode(".",$userip);
    
        if(preg_match('/'.$iparray[0].'\.'.$iparray[1].'\.[0-9]+\.[0-9]+/', $iprange)) {
          //Do your thang here
        }
      
    
    ?>

     

    Should work.

  4. When they say they support SSL, they mean, secure paths can be integrated in their settings so that the shop goes through the secure connection when a user proceeds to a certain point in checkout (Rather than simply running under HTTPS). You also want to make sure your server/host allows both incoming/outgoing connections on port 443 (If you plan on using a payment gateway. In other words...steer clear of crap hosts like GoDaddy).

  5. If your file already looks like...

     

    URL[1] = "http://google.com/"
    URL[2] = "http://yahoo.com/"

     

    Then you can try....

    <?php
    
      $url = explode("\n",file_get_contents($file));
    
        foreach($url as $u) 
        {
           preg_match('/URL\[[0-9]+\] \= \"([aZ-zZ0-9\_\:\/\.\~]+)\"/i', $u, $links[$i]);
           $urls[] = $links[$i][1];
           $i++;
        }
    
    /* The $urls array will output the following...
    
    Array
    (
        [0] => http://google.com/
        [1] => http://yahoo.com/
    )
    
    */
    
    ?>

  6. I'm assuming you either are using constants or aren't sure how to define the url.....

     

    <?php
    
      function get_image($id) {
    
        switch($id) {
          case '1':
            $image = 'webmaster.gif';
          break;
    
          case '2':
            $image = 'global.gif';
          break;
        }
        return $image;
      }
    
      $id = $_GET['id']; // This would be the value in http://yourdomain.com/index.php?id=123
      $img = 'templates/RBL/images/'.get_image($id);
    
      echo '<img src="'.$img.'" order="0" />';
    
    ?>

     

    Possibly something like that....

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