<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>php &#8211; Alessandro Crugnola &#8211; sephiroth.it</title>
	<atom:link href="https://blog.sephiroth.it/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.sephiroth.it</link>
	<description>programmer by pure chance</description>
	<lastBuildDate>Wed, 28 Jul 2010 18:10:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://blog.sephiroth.it/wp-content/uploads/2019/03/cropped-sepy-big-32x32.png</url>
	<title>php &#8211; Alessandro Crugnola &#8211; sephiroth.it</title>
	<link>https://blog.sephiroth.it</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>New Italian Flex community online!</title>
		<link>https://blog.sephiroth.it/2007/03/12/new-italian-flex-community-online/</link>
					<comments>https://blog.sephiroth.it/2007/03/12/new-italian-flex-community-online/#comments</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Mon, 12 Mar 2007 19:54:30 +0000</pubDate>
				<category><![CDATA[flex]]></category>
		<category><![CDATA[janus]]></category>
		<category><![CDATA[php]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=203</guid>

					<description><![CDATA[<a target="_blank" href="http://www.sephiroth.it/movabletype/www.flex-developers.org">flex-developers.org</a> is a new Italian Flex2 community. It's a wiki based community, so everyone can contribute with its own experience by adding/editing articles.<br />Moreover, in collaboration with <a target="_blank" href="http://www.spaghettisort.com/">SpaghettiSort</a>, there will be a full license of <a target="_blank" href="http://www.spaghettisort.com/janus/index.php">Janus</a> as a prize for one of the first 100 registered users.
]]></description>
										<content:encoded><![CDATA[<p><a target="_blank" href="http://www.flex-developers.org">flex-developers.org</a> is a new Italian Flex2 community. It&#8217;s a <dfn title="WIKI is a website that allows visitors to add, remove, and otherwise edit and change content">wiki</dfn> based community, so everyone can contribute with its own experience by adding/editing articles.<br />Moreover, in collaboration with <a target="_blank" href="http://www.spaghettisort.com/">SpaghettiSort</a>, there will be a full license of <a target="_blank" href="http://www.spaghettisort.com/janus/index.php">Janus</a> as a prize for one of the first 100 registered users.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2007/03/12/new-italian-flex-community-online/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Is your Web application secure?</title>
		<link>https://blog.sephiroth.it/2006/05/03/is-your-web-application-secure/</link>
					<comments>https://blog.sephiroth.it/2006/05/03/is-your-web-application-secure/#comments</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Wed, 03 May 2006 18:30:10 +0000</pubDate>
				<category><![CDATA[general]]></category>
		<category><![CDATA[injection]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[xss]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=137</guid>

					<description><![CDATA[&#8220;No language can prevent insecure code, although there are language features which could aid or hinder a security-conscious developer.&#8221; An interesting article on Security Focus illustrates examples on PHP coding and vulnerabilities. The attacks explained in the article are: 1. Remote code execution 2. SQL injection 3. Format string vulnerabilities 4. Cross Site Scripting (XSS) &#8230; <a href="https://blog.sephiroth.it/2006/05/03/is-your-web-application-secure/" class="more-link">Continue reading <span class="screen-reader-text">Is your Web application secure?</span></a>]]></description>
										<content:encoded><![CDATA[<blockquote><p><em>&#8220;No language can prevent insecure code, although there are language features which could aid or hinder a security-conscious developer.&#8221;</em></p></blockquote>
<p>An interesting article on <a href="http://www.securityfocus.com/infocus/1864">Security Focus</a> illustrates examples on PHP coding and vulnerabilities.<br />
The attacks explained in the article are:<br />
1. Remote code execution<br />
2. SQL injection<br />
3. Format string vulnerabilities<br />
4. Cross Site Scripting (XSS)<br />
5. Username enumeration<br />
<a href="http://www.securityfocus.com/infocus/1864">http://www.securityfocus.com/infocus/1864</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2006/05/03/is-your-web-application-secure/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Debugging PHP with XDebug</title>
		<link>https://blog.sephiroth.it/2006/02/16/debugging-php-with-xdebug/</link>
					<comments>https://blog.sephiroth.it/2006/02/16/debugging-php-with-xdebug/#respond</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Thu, 16 Feb 2006 18:53:54 +0000</pubDate>
				<category><![CDATA[php]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[profiler]]></category>
		<category><![CDATA[traceback]]></category>
		<category><![CDATA[xdebug]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=129</guid>

					<description><![CDATA[In these days, working with PHP after a lot of time, I&#8217;ve installed this cool tool for debugging PHP (it supports both PHP 4 and 5). XDebug is really useful for debugging PHP, which is usually not really easy to debug, and also easy to install. It provides a lot of valuable debug informations, for &#8230; <a href="https://blog.sephiroth.it/2006/02/16/debugging-php-with-xdebug/" class="more-link">Continue reading <span class="screen-reader-text">Debugging PHP with XDebug</span></a>]]></description>
										<content:encoded><![CDATA[<p>In these days, working with PHP after a lot of time, I&#8217;ve installed this cool tool for debugging PHP (it supports both PHP 4 and 5).<br />
XDebug is really useful for debugging PHP, which is usually not really easy to debug, and also easy to install.<br />
It provides a lot of valuable debug informations, for example a full <a href="http://www.xdebug.org/screens.php">traceback for errors</a>, <a href="http://www.xdebug.org/docs-profiling.php">profilig</a> with memory and CPU usage, <a href="http://www.xdebug.org/docs-functions.php#profiling">profiling functions </a>, etc..<br />
I really suggest to take a look at it!<br />
Both Windows and Linux versions are available for download<br />
<a href="http://www.xdebug.org">http://www.xdebug.org</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2006/02/16/debugging-php-with-xdebug/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>PHP5: a big failure ?</title>
		<link>https://blog.sephiroth.it/2006/02/16/php5-a-big-failure/</link>
					<comments>https://blog.sephiroth.it/2006/02/16/php5-a-big-failure/#comments</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Thu, 16 Feb 2006 18:52:57 +0000</pubDate>
				<category><![CDATA[general]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[unicode]]></category>
		<category><![CDATA[zend]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=128</guid>

					<description><![CDATA[What&#8217;s happening ? PHP 5 has been presented as a revolution, a lot of new features have been added and a lot of projects have been made. But only a small group of hosters seem interested in supporting PHP 5 on their web servers. It is not so useful to have a beautiful programming language &#8230; <a href="https://blog.sephiroth.it/2006/02/16/php5-a-big-failure/" class="more-link">Continue reading <span class="screen-reader-text">PHP5: a big failure ?</span></a>]]></description>
										<content:encoded><![CDATA[<p>What&#8217;s happening ?<br />
<a href="http://www.php.net/downloads.php">PHP 5</a> has been presented as a <span style="font-weight: bold;">revolution</span>, a lot of new features have been added and a lot of projects have been made. But only a <span style="font-style: italic;">small group of hosters</span> seem interested in supporting PHP 5 on their web servers. It is not so useful to have a beautiful programming language to use if we can&#8217;t apply it to production environments.<br />
But what about the causes ? Maybe they are related to the fact that <a href="http://www.zend.com">Zend </a>decided to <span style="font-weight: bold;">support both</span> PHP 4 and 5 <span style="font-weight: bold;">separately</span>, allowing hoster to choose which version to compile on their webservers, or maybe to the fact that PHP 5 is <span style="font-weight: bold;">not fully compatible</span> with the older versions, and there are some <span style="font-weight: bold;">security-related bugs</span> that increase our doubts.<br />
I&#8217;m using a lot PHP 5 in production environments, without any problem. It is quite <span style="font-weight: bold;">fast and reliable</span>, and has got a lot of useful features that adapt perfectly to enterprise development. We MUST use PHP 5 to help it growing until it become the standard &#8230;<br />
To conclude I&#8217;d like to inform the ones who don&#8217;t know it, that PHP team is <a href="http://www.php.net/%7Ederick/meeting-notes.html">working on the sixth version</a> (yes &#8230; <span style="font-weight: bold;">PHP </span>6 &#8230; and it is available for download at <a href="http://snaps.php.net/">snaps.php.net</a>) that will add to the language a lot of interesting features, such as native support to <a href="http://www.unicode.org">Unicode</a>.<br />
I <span style="font-style: italic;">hope </span>there will be only one (working) version of PHP in the future &#8230;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2006/02/16/php5-a-big-failure/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Foundation PHP 5 for Flash</title>
		<link>https://blog.sephiroth.it/2005/03/30/foundation-php-5-for-flash/</link>
					<comments>https://blog.sephiroth.it/2005/03/30/foundation-php-5-for-flash/#comments</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Thu, 31 Mar 2005 06:53:43 +0000</pubDate>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[book]]></category>
		<category><![CDATA[mysql]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=71</guid>

					<description><![CDATA[php5 book<br />
]]></description>
										<content:encoded><![CDATA[<p><img decoding="async" class="alignleft size-full wp-image-607" title="1590594665" src="https://blog.sephiroth.it/wp-content/uploads/2005/03/1590594665.jpg" alt="" width="200" height="240" srcset="https://blog.sephiroth.it/wp-content/uploads/2005/03/1590594665.jpg 200w, https://blog.sephiroth.it/wp-content/uploads/2005/03/1590594665-125x150.jpg 125w" sizes="(max-width: 200px) 100vw, 200px" />It was from days of Flash 5 which this book first time appeared. Long time has elapsed (expecially considering the informatic times).</p>
<p>Today I see that <a href="http://www.friendsofed.com">friends of Ed</a> has published a new version of this book covering <span style="font-weight: bold;">ActionScript 2.0</span>, <span style="font-weight: bold;">PHP 5</span> and <span style="font-weight: bold;">MySQL 4.1</span>.<br />
Taking a look at the sample PDF chapter available it seems quite well done, clear and simple to read (ok, that is 2nd chapter and it talks of very basic things already&#8230;), but i noticed that it also threats of things/problems which often occured if you use php and flash everyday.. for example escape characters, magic_quotes_gpc etc..<br />
I think i will going to get a copy of the book, it&#8217;s always useful take my mind under exercise&#8230;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2005/03/30/foundation-php-5-for-flash/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>A pure Flash Blog. OpenSource!</title>
		<link>https://blog.sephiroth.it/2004/09/27/a-pure-flash-blog-opensource/</link>
					<comments>https://blog.sephiroth.it/2004/09/27/a-pure-flash-blog-opensource/#respond</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Tue, 28 Sep 2004 05:57:56 +0000</pubDate>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[php]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=33</guid>

					<description><![CDATA[Guys at Motion4graphics.com have developed a flash blog ( www.flashblog.org ), i think the first Weblog made in Flash/Php/MySQL Opensource. It is a project that is in Beta test, but that the main features already are already included. As they said: &#8220;We wished to be extending benefits little by little, we didn&#8217;t want to reinvent &#8230; <a href="https://blog.sephiroth.it/2004/09/27/a-pure-flash-blog-opensource/" class="more-link">Continue reading <span class="screen-reader-text">A pure Flash Blog. OpenSource!</span></a>]]></description>
										<content:encoded><![CDATA[<p>Guys at <a href="http://www.motion4graphics.com/">Motion4graphics.com</a> have developed a flash blog ( <a href="http://www.flashblog.org/">www.flashblog.org</a> ), i think the first Weblog made in Flash/Php/MySQL Opensource.</p>
<p>It is a project that is in Beta test, but that the main features already are already included.   As they said: <em>&#8220;We wished to be extending benefits little by little, we didn&#8217;t want to reinvent the Weblog&#8221;</em>.<br />
Next there will be the feature to donwload all the archives.</p>
<p>The main features are actually:<br />
&#8211; Front End, developed in Flash.<br />
&#8211; BackEnd developed in Php/MySQL<br />
&#8211; Creation of categories.<br />
&#8211; Searches.<br />
&#8211; Limitation of entrances by page.<br />
&#8211; extended Entrances (read more..).<br />
&#8211; Publisher wysiwyg.<br />
&#8211; Multiple users and authors.<br />
&#8211; Limitless vertical Stage.<br />
&#8211; Function botons back/ahead.<br />
&#8211; Source codes FLA including.</p>
<p>Jpegs can be added, including the limitations of flash which can load only non progressive jpegs.. maybe they can add the GD support (or also image magik) in order to let all jpegs compatible and also PNG (waiting for gif support come back in the GD lib) ?<br />
I&#8217;m still trying to understand how is set the framework.. how data is transmitted to flash (xml, remoting or flat loadvars)..</p>
<p>It seems a really promising project. <a href="http://www.flashblog.org/" target="_blank">take a minute to look at this</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2004/09/27/a-pure-flash-blog-opensource/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Installing PHP5 on Apache server</title>
		<link>https://blog.sephiroth.it/2004/07/20/installing-php5-on-apache-server/</link>
					<comments>https://blog.sephiroth.it/2004/07/20/installing-php5-on-apache-server/#respond</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Wed, 21 Jul 2004 06:29:48 +0000</pubDate>
				<category><![CDATA[php]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[phpmyadmin]]></category>
		<category><![CDATA[sqlite]]></category>
		<category><![CDATA[wamp]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=18</guid>

					<description><![CDATA[Today i was trying to install the new PHP5 module on my local apache server. It&#8217;s really simple at least, but when searching for instructions i discovered WAMP5, which includes in the installation: Apache 1.3.31 PHP 5.0.0 MySQL 4.0.18 PhpMyAdmin 2.5.7 sqlitemanager I&#8217;ve immediately installed it &#240;&#159;&#152;&#137; Once installed you&#8217;ll see a new tray icon &#8230; <a href="https://blog.sephiroth.it/2004/07/20/installing-php5-on-apache-server/" class="more-link">Continue reading <span class="screen-reader-text">Installing PHP5 on Apache server</span></a>]]></description>
										<content:encoded><![CDATA[<p><span class="normalText">Today i was trying to install the new PHP5 module on my local apache server.<br />
It&#8217;s really simple at least, but when searching for instructions i discovered <strong>WAMP5</strong>, which includes in the installation: </span></p>
<ul>
<li>Apache 1.3.31</li>
<li>PHP 5.0.0</li>
<li>MySQL 4.0.18</li>
<li>PhpMyAdmin 2.5.7</li>
<li>sqlitemanager</li>
</ul>
<p>I&#8217;ve immediately installed it 😉<br />
Once installed you&#8217;ll see a new tray icon with some options for your installed services.<br />
I sugges it if you are thinking to install PHP5 on your local machine (i have also a separate apache/php4/mysql3 framework on my machine too, in this way i can always switch trought the two version of PHP/MySQL)</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2004/07/20/installing-php5-on-apache-server/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>PHP 5.0.0 Released!</title>
		<link>https://blog.sephiroth.it/2004/07/15/php-5-0-0-released/</link>
					<comments>https://blog.sephiroth.it/2004/07/15/php-5-0-0-released/#respond</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Fri, 16 Jul 2004 06:31:21 +0000</pubDate>
				<category><![CDATA[php]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysqli]]></category>
		<category><![CDATA[soap]]></category>
		<category><![CDATA[sqlite]]></category>
		<category><![CDATA[zend]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=17</guid>

					<description><![CDATA[Finally, after months of release candidates&#8230; Some of the key features of PHP 5 include: * The Zend Engine II with a new object model and dozens of new features. * XML support has been completely redone in PHP 5, all extensions are now focused around the excellent libxml2 library (http://www.xmlsoft.org/). * A new SimpleXML &#8230; <a href="https://blog.sephiroth.it/2004/07/15/php-5-0-0-released/" class="more-link">Continue reading <span class="screen-reader-text">PHP 5.0.0 Released!</span></a>]]></description>
										<content:encoded><![CDATA[<p><span class="normalText">Finally, after months of release candidates&#8230;<br />
Some of the key features of PHP 5 include:</span></p>
<p>* The Zend Engine II with a new object model and dozens of new features.<br />
* XML support has been completely redone in PHP 5, all extensions are now focused around the excellent libxml2 library (http://www.xmlsoft.org/).<br />
* A new SimpleXML extension for easily accessing and manipulating XML as PHP objects. It can also interface with the DOM extension and vice-versa.<br />
* A brand new built-in SOAP extension for interoperability with Web Services.<br />
* A new MySQL extension named MySQLi for developers using MySQL 4.1 and later. This new extension includes an object-oriented interface in addition to a traditional interface; as well as support for many of MySQL&#8217;s new features, such as prepared statements.<br />
* SQLite has been bundled with PHP. For more information on SQLite, please visit their website.<br />
* Streams have been greatly improved, including the ability to access low-level socket operations on streams.<br />
* And lots more&#8230;</p>
<p><a href="http://www.php.net" target="_blank">http://www.php.net</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2004/07/15/php-5-0-0-released/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>PEAR::SWF updating&#8230; read and modify swf with PHP</title>
		<link>https://blog.sephiroth.it/2004/07/07/pearswf-updating-read-and-modify-swf-with-php/</link>
					<comments>https://blog.sephiroth.it/2004/07/07/pearswf-updating-read-and-modify-swf-with-php/#respond</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Thu, 08 Jul 2004 06:36:10 +0000</pubDate>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[pear]]></category>
		<category><![CDATA[swf]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=15</guid>

					<description><![CDATA[I&#8217;ve just begun to modify the old PHP class flashHeader. Now using the PEAR::File class for a better file I/O processes. Basically now, other than returning all the main information from an swf file, such as the bg color, framerate, player version, compression, protection used, movie size.., it allows to modify some of those parameters. &#8230; <a href="https://blog.sephiroth.it/2004/07/07/pearswf-updating-read-and-modify-swf-with-php/" class="more-link">Continue reading <span class="screen-reader-text">PEAR::SWF updating&#8230; read and modify swf with PHP</span></a>]]></description>
										<content:encoded><![CDATA[<p><span class="normalText">I&#8217;ve just begun to modify the old PHP class flashHeader. Now using the PEAR::File class for a better file I/O  processes.<br />
Basically now, other than returning all the main information from an swf file, such as the bg color, framerate, player version, compression, protection used, movie size.., it allows to <strong>modify </strong>some of those parameters.<br />
For example it can change the <strong>framerate, background, protection</strong>&#8230; I&#8217;m also working in order to allows the class modify some other swf tags in runtime..<br />
<a title="PHP SWF Reader ( PEAR::SWF )" href="https://blog.sephiroth.it/projects/php-swf-reader-pearswf/" target="_blank">Working example</a></span></p>
<p>Here the source file<br />
<span style="color: #000000;"><br />
<span style="color: #0000bb;">&lt;?php<br />
</span><span style="color: #ff8000;">// include the PEAR package<br />
</span><span style="color: #007700;">require </span><span style="color: #dd0000;">&#8220;File/File_SWF.php&#8221;</span><span style="color: #007700;">;<br />
</span><span style="color: #0000bb;">$flash </span><span style="color: #007700;">= new </span><span style="color: #0000bb;">SWF</span><span style="color: #007700;">(</span><span style="color: #dd0000;">&#8220;source.swf&#8221;</span><span style="color: #007700;">);<br />
if(</span><span style="color: #0000bb;">$flash</span><span style="color: #007700;">-&gt;</span><span style="color: #0000bb;">is_valid</span><span style="color: #007700;">()){<br />
</span><span style="color: #0000bb;">$stat </span><span style="color: #007700;">= </span><span style="color: #0000bb;">$flash</span><span style="color: #007700;">-&gt;</span><span style="color: #0000bb;">stat</span><span style="color: #007700;">(); </span><span style="color: #ff8000;">// this give all the info<br />
// and also..<br />
</span><span style="color: #0000bb;">$fps </span><span style="color: #007700;">= </span><span style="color: #0000bb;">$flash</span><span style="color: #007700;">-&gt;</span><span style="color: #0000bb;">getFrameRate</span><span style="color: #007700;">();<br />
</span><span style="color: #0000bb;">$size </span><span style="color: #007700;">= </span><span style="color: #0000bb;">$flash</span><span style="color: #007700;">-&gt;</span><span style="color: #0000bb;">getMovieSize</span><span style="color: #007700;">();<br />
</span><span style="color: #0000bb;">$bg </span><span style="color: #007700;">= </span><span style="color: #0000bb;">$flash</span><span style="color: #007700;">-&gt;</span><span style="color: #0000bb;">getBackgroundColor</span><span style="color: #007700;">();<br />
</span><span style="color: #0000bb;">$prot </span><span style="color: #007700;">= </span><span style="color: #0000bb;">$flash</span><span style="color: #007700;">-&gt;</span><span style="color: #0000bb;">getProtected</span><span style="color: #007700;">();<br />
</span><span style="color: #0000bb;">$compr </span><span style="color: #007700;">= </span><span style="color: #0000bb;">$flash</span><span style="color: #007700;">-&gt;</span><span style="color: #0000bb;">getCompression</span><span style="color: #007700;">();<br />
</span><span style="color: #0000bb;">$version </span><span style="color: #007700;">= </span><span style="color: #0000bb;">$flash</span><span style="color: #007700;">-&gt;</span><span style="color: #0000bb;">getVersion</span><span style="color: #007700;">();</p>
<p></span><span style="color: #ff8000;">// they can be changed&#8230;<br />
</span><span style="color: #0000bb;">$flash</span><span style="color: #007700;">-&gt;</span><span style="color: #0000bb;">setFrameRate</span><span style="color: #007700;">(</span><span style="color: #0000bb;">60</span><span style="color: #007700;">);<br />
</span><span style="color: #0000bb;">$flash</span><span style="color: #007700;">-&gt;</span><span style="color: #0000bb;">setProtected</span><span style="color: #007700;">(</span><span style="color: #0000bb;">1</span><span style="color: #007700;">);<br />
</span><span style="color: #0000bb;">$flash</span><span style="color: #007700;">-&gt;</span><span style="color: #0000bb;">setBackgroundColor</span><span style="color: #007700;">(</span><span style="color: #0000bb;">51</span><span style="color: #007700;">,</span><span style="color: #0000bb;">51</span><span style="color: #007700;">,</span><span style="color: #0000bb;">204</span><span style="color: #007700;">);<br />
</span><span style="color: #0000bb;">$flash</span><span style="color: #007700;">-&gt;</span><span style="color: #0000bb;">setCompression</span><span style="color: #007700;">(</span><span style="color: #0000bb;">1</span><span style="color: #007700;">);</p>
<p></span><span style="color: #ff8000;">// and write a new file&#8230;<br />
</span><span style="color: #0000bb;">$flash</span><span style="color: #007700;">-&gt;</span><span style="color: #0000bb;">write</span><span style="color: #007700;">(</span><span style="color: #dd0000;">&#8220;./new_one.swf&#8221;</span><span style="color: #007700;">,</span><span style="color: #0000bb;">1</span><span style="color: #007700;">);<br />
}<br />
</span><span style="color: #0000bb;">?&gt;</span></span></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2004/07/07/pearswf-updating-read-and-modify-swf-with-php/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Ho to get bytesTotal from a dynamic generated content in PHP</title>
		<link>https://blog.sephiroth.it/2004/06/24/ho-to-get-bytestotal-from-a-dynamic-generated-content-in-php/</link>
					<comments>https://blog.sephiroth.it/2004/06/24/ho-to-get-bytestotal-from-a-dynamic-generated-content-in-php/#respond</comments>
		
		<dc:creator><![CDATA[Alessandro Crugnola]]></dc:creator>
		<pubDate>Fri, 25 Jun 2004 06:42:04 +0000</pubDate>
				<category><![CDATA[actionscript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[bytesLoaded]]></category>
		<guid isPermaLink="false">http://blog.sephiroth.it/?p=13</guid>

					<description><![CDATA[Think you want to load from Flash some dynamically generated images from PHP (maybe using GD..), or also some else dynamic content.. Think at this simple code: /**** MovieClip Loader listener ****/ loaderListener = { onLoadStart : function(){ trace('load started!'); trace(" ----------------------------------- ") }, onLoadProgress : function(target, bLoaded, bTotal){ trace(bLoaded + "/" + bTotal) }, &#8230; <a href="https://blog.sephiroth.it/2004/06/24/ho-to-get-bytestotal-from-a-dynamic-generated-content-in-php/" class="more-link">Continue reading <span class="screen-reader-text">Ho to get bytesTotal from a dynamic generated content in PHP</span></a>]]></description>
										<content:encoded><![CDATA[<p><span class="normalText">Think you want to load from Flash some dynamically generated images from PHP (maybe using GD..), or also some else dynamic content..<br />
Think at this simple code: </span></p>
<pre>/**** MovieClip Loader listener ****/
loaderListener = {
	onLoadStart : function(){
		trace('load started!');
		trace(" ----------------------------------- ")
	},
	onLoadProgress : function(target, bLoaded, bTotal){
		trace(bLoaded + "/" + bTotal)
	},
	onLoadComplete : function(target){
		trace(" ----------------------------------- ")
		trace("complete: " + target.getBytesTotal());
		trace(" ----------------------------------- ")
	}
}

// I just add the rand variable to prevent caching...
movie_path = "http://local/ob_start.php?file=C:/DSCF0182.JPG&amp;rand=" + new Date().getTime()
var mcLoader = new MovieClipLoader()
mcLoader.loadClip(movie_path, loader)
mcLoader.addListener( loaderListener )</pre>
<p>Now, if your PHP code is written in this way (just a image copy and resize using the GD 2.x library):</p>
<pre><span style="color: #000000;">
<span style="color: #0000bb;">&lt;?php</span>
<span style="color: #ff8000;">// Get the required image from GET</span>
<span style="color: #0000bb;">$image </span><span style="color: #007700;">= </span><span style="color: #0000bb;">$_GET</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'file'</span><span style="color: #007700;">];</span><span style="color: #0000bb;">$size </span><span style="color: #007700;">= </span><span style="color: #0000bb;">getimagesize</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$image</span><span style="color: #007700;">);</span>
<span style="color: #ff8000;">// create an empty image and copy the original</span>
<span style="color: #0000bb;">$dst_img </span><span style="color: #007700;">= </span><span style="color: #0000bb;">imagecreatetruecolor</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$size</span><span style="color: #007700;">[</span><span style="color: #0000bb;">0</span><span style="color: #007700;">]/</span><span style="color: #0000bb;">4</span><span style="color: #007700;">, </span><span style="color: #0000bb;">$size</span><span style="color: #007700;">[</span><span style="color: #0000bb;">1</span><span style="color: #007700;">]/</span><span style="color: #0000bb;">4</span><span style="color: #007700;">);</span>
<span style="color: #0000bb;">$src_img </span><span style="color: #007700;">= </span><span style="color: #0000bb;">imagecreatefromjpeg</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$image</span><span style="color: #007700;">);</span>
<span style="color: #ff8000;">// resize image</span>
<span style="color: #0000bb;">imagecopyresized</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$dst_img</span><span style="color: #007700;">, </span><span style="color: #0000bb;">$src_img</span><span style="color: #007700;">, </span><span style="color: #0000bb;">0</span><span style="color: #007700;">, </span><span style="color: #0000bb;">0</span><span style="color: #007700;">, </span><span style="color: #0000bb;">0</span><span style="color: #007700;">, </span><span style="color: #0000bb;">0</span><span style="color: #007700;">, </span><span style="color: #0000bb;">$size</span><span style="color: #007700;">[</span><span style="color: #0000bb;">0</span><span style="color: #007700;">]/</span><span style="color: #0000bb;">4</span><span style="color: #007700;">, </span><span style="color: #0000bb;">$size</span><span style="color: #007700;">[</span><span style="color: #0000bb;">1</span><span style="color: #007700;">]/</span><span style="color: #0000bb;">4</span><span style="color: #007700;">, </span><span style="color: #0000bb;">$size</span><span style="color: #007700;">[</span><span style="color: #0000bb;">0</span><span style="color: #007700;">], </span><span style="color: #0000bb;">$size</span><span style="color: #007700;">[</span><span style="color: #0000bb;">1</span><span style="color: #007700;">]);</span>
<span style="color: #ff8000;">// start output content</span>
<span style="color: #0000bb;">header</span><span style="color: #007700;">(</span><span style="color: #dd0000;">"Content-type: image/jpeg"</span><span style="color: #007700;">);</span>
<span style="color: #ff8000;">// display the image</span>
<span style="color: #0000bb;">imagejpeg</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$dst_img</span><span style="color: #007700;">, </span><span style="color: #dd0000;">""</span><span style="color: #007700;">, </span><span style="color: #0000bb;">80</span><span style="color: #007700;">);</span>
<span style="color: #0000bb;">?&gt;</span>
</span></pre>
<p>You will be noticed that the <strong>bytesTotal</strong> variable in flash is always &#8216;0&#8217;!<br />
This could be a problem if you want to use any kind of graphic preloader for this such of things&#8230;<br />
However with some little more code it&#8217;s always possible to get in flash (and not only from flash) the exact content bytes lenght.<br />
Try now this:</p>
<pre><span style="color: #0000bb;">&lt;?php
</span><span style="color: #ff8000;">// Turn on output buffering
</span><span style="color: #0000bb;"><a href="http://www.php.net/ob_start">ob_start</a></span><span style="color: #007700;">();
</span><span style="color: #ff8000;">// Get the required image from GET
</span><span style="color: #0000bb;">$image </span><span style="color: #007700;">= </span><span style="color: #0000bb;">$_GET</span><span style="color: #007700;">[</span><span style="color: #dd0000;">'file'</span><span style="color: #007700;">];
</span><span style="color: #0000bb;">$size </span><span style="color: #007700;">= </span><span style="color: #0000bb;">getimagesize</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$image</span><span style="color: #007700;">);
</span><span style="color: #ff8000;">// create an empty image and copy the original
</span><span style="color: #0000bb;">$dst_img </span><span style="color: #007700;">= </span><span style="color: #0000bb;">imagecreatetruecolor</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$size</span><span style="color: #007700;">[</span><span style="color: #0000bb;">0</span><span style="color: #007700;">]/</span><span style="color: #0000bb;">4</span><span style="color: #007700;">, </span><span style="color: #0000bb;">$size</span><span style="color: #007700;">[</span><span style="color: #0000bb;">1</span><span style="color: #007700;">]/</span><span style="color: #0000bb;">4</span><span style="color: #007700;">);
</span><span style="color: #0000bb;">$src_img </span><span style="color: #007700;">= </span><span style="color: #0000bb;">imagecreatefromjpeg</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$image</span><span style="color: #007700;">);
</span><span style="color: #ff8000;">// resize image
</span><span style="color: #0000bb;">imagecopyresized</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$dst_img</span><span style="color: #007700;">, </span><span style="color: #0000bb;">$src_img</span><span style="color: #007700;">, </span><span style="color: #0000bb;">0</span><span style="color: #007700;">, </span><span style="color: #0000bb;">0</span><span style="color: #007700;">, </span><span style="color: #0000bb;">0</span><span style="color: #007700;">, </span><span style="color: #0000bb;">0</span><span style="color: #007700;">, </span><span style="color: #0000bb;">$size</span><span style="color: #007700;">[</span><span style="color: #0000bb;">0</span><span style="color: #007700;">]/</span><span style="color: #0000bb;">4</span><span style="color: #007700;">, </span><span style="color: #0000bb;">$size</span><span style="color: #007700;">[</span><span style="color: #0000bb;">1</span><span style="color: #007700;">]/</span><span style="color: #0000bb;">4</span><span style="color: #007700;">, </span><span style="color: #0000bb;">$size</span><span style="color: #007700;">[</span><span style="color: #0000bb;">0</span><span style="color: #007700;">], </span><span style="color: #0000bb;">$size</span><span style="color: #007700;">[</span><span style="color: #0000bb;">1</span><span style="color: #007700;">]);
</span><span style="color: #ff8000;">// start output content
</span><span style="color: #0000bb;">header</span><span style="color: #007700;">(</span><span style="color: #dd0000;">"Content-type: image/jpeg"</span><span style="color: #007700;">);
</span><span style="color: #ff8000;">// display the image
</span><span style="color: #0000bb;">imagejpeg</span><span style="color: #007700;">(</span><span style="color: #0000bb;">$dst_img</span><span style="color: #007700;">, </span><span style="color: #dd0000;">""</span><span style="color: #007700;">, </span><span style="color: #0000bb;">80</span><span style="color: #007700;">);
</span><span style="color: #ff8000;">// send the content lenght to output
</span><span style="color: #0000bb;">header</span><span style="color: #007700;">(</span><span style="color: #dd0000;">"Content-Length: "</span><span style="color: #007700;">. </span><span style="color: #0000bb;"><a href="http://www.php.net/ob_get_length">ob_get_length</a></span><span style="color: #007700;">());
</span><span style="color: #ff8000;">// flush the output
</span><span style="color: #0000bb;"><a href="http://www.php.net/ob_end_flush">ob_end_flush</a></span><span style="color: #007700;">();
</span><span style="color: #0000bb;">?&gt;</span></pre>
<p><!--http://www.php.net/ob_start--></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.sephiroth.it/2004/06/24/ho-to-get-bytestotal-from-a-dynamic-generated-content-in-php/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
