Reply to How to pass variable to operating system.

Your name:

Reply:


Posted by Henk Oegema on 10/09/07 18:15

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.4webhelp.net/ #
# Neither http://www.4webhelp.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=.........

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация