Query: swf_closefile
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
SWF_CLOSEFILE(3) 1 SWF_CLOSEFILE(3) swf_closefile - Close the current Shockwave Flash fileSYNOPSISvoid swf_closefile ([int $return_file])DESCRIPTIONClose a file that was opened by the swf_openfile(3) function.PARAMETERSo $return_file - If set then the contents of the SWF file are returned from the function.RETURN VALUESNo value is returned.EXAMPLESExample #1 Creating a simple flash file based on user input and outputting it and saving it in a database <?php // The $text variable is submitted by the // user // Global variables for database // access (used in the swf_savedata() function) $DBHOST = "localhost"; $DBUSER = "sterling"; $DBPASS = "secret"; swf_openfile("php://stdout", 256, 256, 30, 1, 1, 1); swf_definefont(10, "Ligon-Bold"); swf_fontsize(12); swf_fontslant(10); swf_definetext(11, $text, 1); swf_pushmatrix(); swf_translate(-50, 80, 0); swf_placeobject(11, 60); swf_popmatrix(); swf_showframe(); swf_startdoaction(); swf_actionstop(); swf_enddoaction(); $data = swf_closefile(1); $data ? swf_savedata($data) : die("Error could not save SWF file"); // void swf_savedata(string data) // Save the generated file a database // for later retrieval function swf_savedata($data) { global $DBHOST, $DBUSER, $DBPASS; $dbh = @mysql_connect($DBHOST, $DBUSER, $DBPASS); if (!$dbh) { die (sprintf("Error [%d]: %s", mysql_errno(), mysql_error())); } $stmt = "INSERT INTO swf_files (file) VALUES ('$data')"; $sth = @mysql_query($stmt, $dbh); if (!$sth) { die (sprintf("Error [%d]: %s", mysql_errno(), mysql_error())); } @mysql_free_result($sth); @mysql_close($dbh); } ?>SEE ALSOswf_openfile(3). PHP Documentation Group SWF_CLOSEFILE(3)
Related Man Pages |
---|
pdostatement.fetchall(3) - php |
ibase_query(3) - php |
mysql_create_db(3) - php |
mysql_drop_db(3) - php |
swf_closefile(3) - php |
Similar Topics in the Unix Linux Community |
---|
validate csv file load |
hi |
Copy same file with different variables |