The NS has launched a new space transportation service, using German trains which were upgraded into spaceships.
Verwijderd
Heb je wel rechten om het commando uit te voeren?
Probeer dit anders eens:
Probeer dit anders eens:
PHP:
1
2
3
4
5
6
| <?php $output = `uptime`; echo $output; ?> |
oftewelsystem() is just like the C version of the function in that it executes the given command and outputs the result. If a variable is provided as the second argument, then the return status code of the executed command will be written to this variable
jou $output zou hooguit een statuscode moeten bevatten
probeer eens
PHP:
1
| echo system("commando"); |
dat uptime test scriptje werkt wel gewoon, alleen mijn wvWare commando wat op de shell wel werkt hier niet 
Output op de shell:
PHP:
1
2
3
4
5
| <?php $output = `/usr/local/bin/wvWare -c tis-620 -x '/home/Tux/wvHtml.xml' -d '/tmp/' '/home/Tux/blaat.doc' `; echo $output; ?> |
Output op de shell:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
| [root@Pluto www]# /usr/local/bin/wvWare -c tis-620 -x '/home/Tux/wvHtml.xml' -d '/tmp/' '/home/Tux/blaat.doc' <P align="left"> Hallo ik ben Pietje Puk :P </P> <P align="left"> </P> </body> </html> |
The NS has launched a new space transportation service, using German trains which were upgraded into spaceships.
Heb je in de bovenstaande code die linefeed er ook echt in staan, of is dat alleen voor de leesbaaheid?Tux schreef op 16 oktober 2002 @ 21:23:
dat uptime test scriptje werkt wel gewoon, alleen mijn wvWare commando wat op de shell wel werkt hier niet
PHP:
1 2 3 4 5 <?php $output = `/usr/local/bin/wvWare -c tis-620 -x '/home/Tux/wvHtml.xml' -d '/tmp/' '/home/Tux/blaat.doc' `; echo $output; ?>
Output op de shell:
[snip]
Localhost, sweet localhost
Verwijderd
Het punt is dat system volgens mij inderdaad alleen maar de error_code teruggeeft, indien van toepassing. Als het commando succesvol uitgevoerd wordt, krijgt ie 0 terug, en PHP cast de int 0 bij de echo functie automatisch naar een string, en daarbij wordt volgens mij de string een lege string, ergo je ziet niets geoutput worden.
Cronjob:
en PHP cast de int 0 bij de echo functie automatisch naar een string, en daarbij wordt volgens mij de string een lege string, ergo je ziet niets geoutput worden.
euh...
doe eens
PHP:
1
| echo 0; |
Music is the pleasure the human mind experiences from counting without being aware that it is counting
~ Gottfried Leibniz
Pagina: 1