П О Р Т А Л                            
С Е Т Е В Ы Х                          
П Р О Е К Т О В                        
  
Поиск по сайту:
                                                 
Главная

О проекте

Web-мастеру
     HTML & JavaScript
     SSI
     Perl
     PHP
     XML & XSLT
     Unix Shell

MySQL

Безопасность

Хостинг

Другое








Самое читаемое:

Учебник PHP - "Для Чайника".
Просмотров 5565 раз(а).

Иллюстрированный самоучитель по созданию сайтов.
Просмотров 7865 раз(а).

Учебник HTML.
Просмотров 4617 раз(а).

Руководство по PHP5.
Просмотров 1184 раз(а).

Хостинг через призму DNS.
Просмотров 6459 раз(а).

Подборка текстов стандартных документов.
Просмотров 57235 раз(а).

Учебник PHP - Самоучитель
Просмотров 4843 раз(а).

Документация на MySQL (учебник & справочное руководство)
Просмотров 10898 раз(а).

Внешние атаки...
Просмотров 6504 раз(а).

Учебник PHP.
Просмотров 3943 раз(а).

SSI в примерах.
Просмотров 964 раз(а).



 
 
| Добавить в избранное | Сделать стартовой | Помощь





Руководство по PHP
Пред. След.

swf_closefile

(PHP 4, PECL)

swf_closefile -- Close the current Shockwave Flash file

Description

void swf_closefile ( [int return_file] )

Close a file that was opened by the swf_openfile() function. If the return_file parameter is set then the contents of the SWF file are returned from the function.

Пример 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);
}
?>



Если Вы не нашли что искали, то рекомендую воспользоваться поиском по сайту:
 





Copyright © 2005-2016 Project.Net.Ru