Dit volgende script is de basis van een script waarmee ik via IE berichten wil zenden aan m`n huisgenoten. Waar het om gaat is dat hij het "echo $verhaal | smbclient -M $naam -I $ip";" niet wil uitvoeren.
Maar zodra ik ipv $naam gewoon hard de naam invoer doet hij het wel.
Weet iemand wat ik fout doe?
Maar zodra ik ipv $naam gewoon hard de naam invoer doet hij het wel.
Weet iemand wat ik fout doe?
PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
| $verhaal = 'gelukt'; $ip = '192.168.0.2'; $ping = shell_exec("ping -c 1 -s 10 -w 0 $ip"); if (eregi("Unreachable", $ping)) { echo 'Dit adres bestaat niet!'; } else { $naam = shell_exec("nmblookup -A $ip"); $naam = explode(" ", $naam); $naam = $naam['4']; $naam = ereg_replace($ip, '', $naam); $command = "echo $verhaal | smbclient -M $naam -I $ip"; echo $command; $uitkomst = shell_exec($command); echo "<br><br><pre> $uitkomst </pre>"; } |
[ Voor 13% gewijzigd door DumbAss op 31-01-2003 15:41 ]