Afficher un message
Vieux 09/10/2007, 19h15   #1
Henk Oegema
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut How to pass variable to operating system.

In the php script below I use 3 variables:
1. &day
2. $hour
3. $minute.


Filename:/opt/lampp/htdocs/uptime/uptime.php

<?php

################################################## #########################
# #
# Copyright © http://www.4web.net/ #
# Neither http://www.4web.net/ nor its members accept any #
# responsibility, either expressed or implied, for any damage caused by #
# using this script or the misuse of this script. #
# #
# Adapted for Asterisk PBX by Henk Oegema #
# #
# INSTRUCTIONS #
# #
# 1) Copy this code to an editor such as Notepad and save it with a #
# .php extension. #
# 2) FTP this file to a folder on your site in ASCII mode #
# 3) Call up this file in your web browser to see your server's uptime #
# #
################################################## #########################

$data = shell_exec('uptime');
$uptime = explode(' up ', $data);
$uptime = explode(',', $uptime[1]);
$uptime = $uptime[0].' ' .$uptime[1];


$days = explode(' ', $uptime);
$hours = explode(':', $days[3]);

$day = $days[0];
$hour = $hours[0];
$minute = $hours[1];

?>

Question: How to I pass those 3 variables from the script, to 3 variables in
Linux (Debian).

Something like:
asterisk:~# day=${CURL(http://localhost/uptime/uptime.php)} (?????)
asterisk:~# hour=...........
asterisk:~# minute=.........


  Réponse avec citation
 
Page generated in 0,05331 seconds with 9 queries