• 12-06-2015, 22:26:22
    #1
    merhaba
    bir web site projemde bağlı olduğum wifi adını göstermek istiyorum PHP de mümkün mü mümkünse nasıl yapabilirim?
  • 12-06-2015, 23:56:58
    #2
    Client side ise PHP ile mumkun degil.
  • 13-06-2015, 06:21:02
    #3
    @emrenazli; aşağıdaki betik ile talep ettiğiniz işlemi yapabilirsiniz.

    Örnek;



    <?php
    
    	try
    	{
    		$response = shell_exec('netsh wlan show interfaces');
    
    		$lines = explode("Hosted network status", $response);
    		$lines = explode("\n", $lines[0]);
    		$lines = array_map('trim', $lines);
    
    		$wlanInterfaces = array();
    
    		$wlanInterfaceCount = preg_match('/(?<![\d-])(0*[1-9]\d*)\b/', $lines[1], $matches) ? end($matches) : null;
    
    		$itemCount = 17;
    
    		$scannedLines = array();
    
    		foreach ($lines as $line)
    		{
    			if (preg_match('/(.*?)\:\s(.*?)/', $line))
    			{
    				$scannedLines[] = $line;
    			}
    		}
    		
    		$wlanInterfaces = array_chunk($scannedLines, $itemCount);
    
    		foreach ($wlanInterfaces as $index => $wlanInterface)
    		{
    			$tempArray = array();
    
    			foreach ($wlanInterface as $line)
    			{
    				$matches = preg_match('/(.*?)(\s+)(\:)(\s)(.*)/', $line, $matches) ? $matches : null;
    
    				$key = str_replace(array('-', ' ', '(', ')'), '', trim($matches[1]));
    
    				$tempArray[$key] = end($matches);
    			}
    
    			$wlanInterfaces[$index] = $tempArray;
    		}
    
    		print_r($wlanInterfaces);
    	}
    	catch (Exception $exception)
    	{
    		echo $exception->getMessage() . PHP_EOL;
    	}
  • 13-06-2015, 10:16:35
    #4
    safakbalcan adlı üyeden alıntı: mesajı görüntüle
    @emrenazli; aşağıdaki betik ile talep ettiğiniz işlemi yapabilirsiniz.

    Örnek;



    <?php
    
    	try
    	{
    		$response = shell_exec('netsh wlan show interfaces');
    
    		$lines = explode("Hosted network status", $response);
    		$lines = explode("\n", $lines[0]);
    		$lines = array_map('trim', $lines);
    
    		$wlanInterfaces = array();
    
    		$wlanInterfaceCount = preg_match('/(?<![\d-])(0*[1-9]\d*)\b/', $lines[1], $matches) ? end($matches) : null;
    
    		$itemCount = 17;
    
    		$scannedLines = array();
    
    		foreach ($lines as $line)
    		{
    			if (preg_match('/(.*?)\:\s(.*?)/', $line))
    			{
    				$scannedLines[] = $line;
    			}
    		}
    		
    		$wlanInterfaces = array_chunk($scannedLines, $itemCount);
    
    		foreach ($wlanInterfaces as $index => $wlanInterface)
    		{
    			$tempArray = array();
    
    			foreach ($wlanInterface as $line)
    			{
    				$matches = preg_match('/(.*?)(\s+)(\:)(\s)(.*)/', $line, $matches) ? $matches : null;
    
    				$key = str_replace(array('-', ' ', '(', ')'), '', trim($matches[1]));
    
    				$tempArray[$key] = end($matches);
    			}
    
    			$wlanInterfaces[$index] = $tempArray;
    		}
    
    		print_r($wlanInterfaces);
    	}
    	catch (Exception $exception)
    	{
    		echo $exception->getMessage() . PHP_EOL;
    	}
    Teşekkürler +r10