• پایان فعالیت بخشهای انجمن: امکان ایجاد موضوع یا نوشته جدید برای عموم کاربران غیرفعال شده است

اجرا فایل روی سرور

byvafa

کاربر تازه وارد
تاریخ عضویت
7 آپریل 2005
نوشته‌ها
175
لایک‌ها
0
سلام
قبلا یه جای دیدم که با php یه فایل exe رو روی سرور اجرا می کردن ...
اون موقع نیاز نداشتم پی گیر نشدم :(

خب اما الا گرفتار شدم :wacko:;)

می خواستم ببینم چجوریاست ؟
چه توابعی رو پیگیری کنم ؟ چه مبحثی رو ؟
میشه به فایل exe رو باز کنیم و یه فایل بهش بدیم و بعد خروجیش رو به کاربر نشون بدیم :eek: ها ؟ کاراییش در چه حده ؟

پیشاپیش ممنون :rolleyes:
 

متالیک

کاربر قدیمی پرشین تولز
کاربر قدیمی پرشین تولز
تاریخ عضویت
31 مارس 2007
نوشته‌ها
2,133
لایک‌ها
286
exec
(PHP 3, PHP 4, PHP 5)

exec -- Execute an external program
Description
string exec ( string command [, array &output [, int &return_var]] )


exec() executes the given command.

Parameters


command
The command that will be executed.

output
If the output argument is present, then the specified array will be filled with every line of output from the command. Trailing whitespace, such as \n, is not included in this array. Note that if the array already contains some elements, exec() will append to the end of the array. If you do not want the function to append elements, call unset() on the array before passing it to exec().

return_var
If the return_var argument is present along with the output argument, then the return status of the executed command will be written to this variable.


Return Values
The last line from the result of the command. If you need to execute a command and have all the data from the command passed directly back without any interference, use the passthru() function.

To get the output of the executed command, be sure to set and use the output parameter.

Examples
????? 1. An exec() example

PHP:
<?php
// outputs the username that owns the running php/httpd process
// (on a system with the "whoami" executable in the path)
echo exec('whoami');
?>
 
بالا