faqts : Computers : Programming : Languages : PHP : Function Libraries : File Handling

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

8 of 12 people (67%) answered Yes
Recently 6 of 10 people (60%) answered Yes

Entry

How can I use 'passthru' to start a program on the server and to send the created .wav-file back to the browser??

Oct 30th, 2001 01:22
Onno Benschop, Robert Ames, Yoko Y., http://www.php.net/passthru


// must make sure user data is safe
$user_data = escape_shell_cmd( $user_data ) ;

// set up the command
$cmd = "txt_to_speech $user_data" ;

// tell browser what kind of content to expect
header( "Content-Type: audio/x-wav" ) ;

// give the file to the user
passthru ($cmd) ;