passthru

(PHP 3, PHP 4 , PHP 5)

passthru --  Execute an external program and display raw output

Popis

void passthru ( string command [, int &return_var] )

The passthru() function is similar to the exec() function in that it executes a command. If the return_var argument is present, the return status of the Unix command will be placed here. This function should be used in place of exec() or system() when the output from the Unix command is binary data which needs to be passed directly back to the browser. A common use for this is to execute something like the pbmplus utilities that can output an image stream directly. By setting the Content-type to image/gif and then calling a pbmplus program to output a gif, you can create PHP scripts that output images directly.

Varovanie

Ak povol�te, aby d�ta prich�dzaj�ce z u��vate�sk�ho vstupu boli posielan� tejto funkcii, potom by ste mali pou��va� escapeshellarg() alebo escapeshellcmd() pre uistenie sa, �e u��vatelia nem�u prelsti� syst�m na spracovanie �ubovo�n�ch pr�kazov.

Poznámka: Ak spust�te program vyu��vaj�ci t�to funkciu a chcete ho necha� be�a� na pozad�, mus�te sa uisti�, �i je v�stup tohto programu presmerovan� do s�boru alebo nejak�ho in�ho v�stupn�ho pr�du lebo inak PHP zostane vysie� pokia� sa spracovanie programu neskon��.

Poznámka: Ke� je safe mode povolen�, mo�ete iba sp�a� spustiteln� s�bory v r�mci safe_mode_exec_dir. Z praktick�ch d�vodov nie je moment�lne povolen� ma� .. komponenty v ceste k spustite�n�mu s�boru.

Varovanie

S povolen�m safe mode, sa so v�etk�mi slovami n�sleduj�cimi za po�iato�n�m re�azcom pr�kazu zaobch�dza ako s jedn�m argumentom. Teda, echo y | echo x sa st�va echo "y | echo x".

See also exec(), system(), popen(), escapeshellcmd(), and the backtick operator.