Jump to content

kickassamd

Members
  • Posts

    102
  • Joined

  • Last visited

    Never

Posts posted by kickassamd

  1. This works if say I do 192.168.0.1 - 192.168.1.254 it will work. However doing 192.168.0.1 - 192.168.1.10 will only generate up to .10 on both IP schemes. I see why, but I cannot figure out a way around this...

     

    Thanks!

    $start = explode('.', '192.168.10.1');
    $end = explode('.', '192.168.11.10');
    
    /**
     * Final output...
     */
    $a = 0;
    $b = 0;
    $c = 0;
    $d = 0;
    
    // First segment
    for ($a = $start[0]; $a < 1 + $end[0]; $a++)
    {
    	// Second segment
    	for ($b = $start[1]; $b < 1 + $end[1]; $b++)
    	{
    		// Third segment
    		for ($c = $start[2]; $c < 1 + $end[2]; $c++)
    		{
    			// Fourth segment
    			for ($d = $start[3]; $d < 1 + $end[3]; $d++)
    			{
    				echo "{$a}.{$b}.{$c}.{$d}<br />";
    			}
    		}
    	}
    }
    

  2. I have installed isapi_rewrite from HeliconTech for IIS

     

    I currently have

    RewriteRule ^(.*?\.php)/([^/]*)/([^/]*)(/.+)? $1$4?$2=$3 [NC,LP,QSA] 

     

    But this requires site.com/index.php/page/news to do index.php?page=news

     

    I am trying to get it to do site.com/page/news and send the results to site.com/index.php?page=news

     

    Basically no filename in the URL. Is there anyone good with rewrite rules that can help?

     

    Thanks!

  3. <?php
    
    class aClassName
    {
    public function register($varName, $varValue)
    {
    	// In here i would like to get the classes name that called this function.
    }
    }
    
    class thisWillCallaClassName
    {
    public function blah()
    {
    	// I would like to call aClassName->register() from here and set this classes name automatically with no extra parameters to register
    }
    }
    ?>
    

     

    Is it possible to have a class that when called from within another class can get the classes name that is calling a function within. IE

     

    class people

     

    class bob -> calls a method in the people class, and the people class knows it was the class bob who is talking to it.

  4. Why in the world would you actually pay for Windows hosting?  If you were on Linux, you could use cron, but I don't think that Plesk gives you access to the Windows scheduler program, which I think is crappy anyway (it's been a long time since I used Windows, so I don't remember).

     

    There is a billion reasons I would use Windows (especially Server 2008) before Linux servers, but using Plesk atleast v8 you can set the schedule to run every x minutes \ days etc etc and what script to run etc etc.

     

    With HELM I had to specify the path to PHP IE

    c:\php\php-cgi.exe c:\domains\domain.com\wwwroot\script.php

     

    This worked.

  5. Just wondering how others handle creating isntances of mutliple objects...

     

    I usually have 1 file that includes all my classes then from there i create all my instances there.

     

    How does everyone else do it?

  6. Was wondering if anyone has any examples of a query builder...

     

    public function compileInsertQuery($table, $data, $autoClean = true)
    {
    	// Valid data
    	if (is_array($data))
    	{
    		$fields = "";
    		$values = "";
    		foreach ($data as $key => $value)
    		{
    			$fields .= "{$this->_colDelimiters['left']}{$key}{$this->_colDelimiters['right']}, ";
    			if ($autoClean)
    			{
    				$values .= "{$this->_strDelimiters['left']}{$this->cleanString($value)}{$this->_strlDelimiters['right']}, ";
    			}
    			else
    			{
    				$values .= "{$this->_strDelimiters['left']}{$value}{$this->_colDelimiters['right']}, ";
    			}
    		}
    
    		// Strip last , from string
    		$fields = preg_replace("/, $/", "", $fields);
    		$values = preg_replace("/, $/", "", $values);
    
    		$query = "INSERT INTO {$this->addTablePrefix($table)} ({$fields}) VALUES({$values})";
    		return $query;
    	}
    }

     

    Is mine but i was wondering if anyone knows of anyways to improve it etc.

  7. I cannot figure out how to get preg_match to match

     

    = <= >= !=

     

    I had a simple function that looked for each but the problem with that is it found = when it was really <= so is there a way with regex to match ONLY the character supplied?

  8. Been trying to extract the kilobytes sent number from this string...

     

    Server Statistics for \\testbox Statistics since 5/2/2008 4:06 PM Sessions accepted 1 Sessions timed-out 0 Sessions errored-out 0 Kilobytes sent 16 Kilobytes received 17 Mean response time (msec) 0 System errors 0 Permission violations 0 Password violations 0 Files accessed 16 Communication devices accessed 0 Print jobs spooled 0 Times buffers exhausted Big buffers 0 Request buffers 0 The command completed successfully.

     

    ive tried

     

    Kilobytes sent [0-9]

    Kilobytes sent \d+

    Kilobytes sent \d

     

    And i get no matches...

    preg_match('{Kilobytes sent \d+}', $this->_netStats, $matches);

     

    Any help is very appreciated!

  9. Im confused on storing a menu system with a parent \ child relationship in mySQL and how to retreive and display it.

     

    Example...

     

    MAIN----

          ---- SUBITEM

          ---- SUBITEM

    MAIN----

        ----- SUBITEM

     

    etc etc.

     

    Thanks guys!

  10. I can login to PHPMyAdmin from the server itself. But once i got to a remote machine (on same network) and login it just sends me write back to the login page no notices no errors nothing.... Even if i type jibber into the username \ password fields and press login it just sends me right back to the login page.

     

    For a demo go here

    http://phpmyadmin.seriussoft.com

     

    Login with anything random and press login... Obviously "fdfdsfdsfdsf324" and "fdfdsr323333!!!" is not a valid username \ password so PHPMyAdmin should return an error but it doesnt. Just reloads the page.

     

    Any reason?

     

     

    Thanks!

  11. Have you contacted your host? Last time I had an issue like this b4 I moved to Windows hosting was with Host Gator and I couldnt execute a few PHP files because of the UID or something was incorrect, contacted them and walla.

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