<?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 Magic Book - Free PHP Scripts, Tutorials and Downloads &#187; Flash &amp; PHP</title>
	<atom:link href="http://www.phpmagicbook.com/tag/flash-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.phpmagicbook.com</link>
	<description>PHP AtoZ Reloaded, free php tutorials, free php downloads, php scripts, PHP tips</description>
	<lastBuildDate>Tue, 15 Jun 2010 13:22:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Random Flash SWF Onload PHP Script</title>
		<link>http://www.phpmagicbook.com/random-flash-swf-onload-php-script/</link>
		<comments>http://www.phpmagicbook.com/random-flash-swf-onload-php-script/#comments</comments>
		<pubDate>Wed, 18 Jun 2008 09:46:20 +0000</pubDate>
		<dc:creator>Hiroshi</dc:creator>
				<category><![CDATA[Flash & PHP]]></category>
		<category><![CDATA[Randomizing]]></category>
		<category><![CDATA[Rotating Content]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[random content]]></category>

		<guid isPermaLink="false">http://www.phpmagicbook.com/?p=109</guid>
		<description><![CDATA[Put all your swf files in a folder named as &#8216;images&#8217; or whatever you name it (change folder name in script) and use this script to display a random flash movie, everytime page loads. PHP Code &#60;?php $imglist=''; //$img_folder is the variable that holds the path to the swf files. // see that you dont [...]<p><a href="http://www.phpmagicbook.com/random-flash-swf-onload-php-script/">Random Flash SWF Onload PHP Script</a> is a post from: <a href="http://www.phpmagicbook.com">PHP Magic Book - Free PHP Scripts, Tutorials and Downloads</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Put all your swf files in a folder named as &#8216;images&#8217; or whatever you name it (change folder name in script) and use this script to display a random flash movie, everytime page loads.</p>
<p><span id="more-195"></span></p>
<h4>PHP Code</h4>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$imglist</span><span style="color: #339933;">=</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//$img_folder is the variable that holds the path to the swf files.</span>
<span style="color: #666666; font-style: italic;">// see that you dont forget about the &quot;/&quot; at the end</span>
<span style="color: #000088;">$img_folder</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;images/&quot;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">mt_srand</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>double<span style="color: #009900;">&#41;</span><span style="color: #990000;">microtime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//use the directory class</span>
<span style="color: #000088;">$imgs</span> <span style="color: #339933;">=</span> <span style="color: #990000;">dir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$img_folder</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//read all files from the directory, ad them to a list</span>
<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$imgs</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">read</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">eregi</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;swf&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #000088;">$imglist</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$file</span> &quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #990000;">closedir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$imgs</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//put all images into an array</span>
<span style="color: #000088;">$imglist</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$imglist</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$no</span> <span style="color: #339933;">=</span> <span style="color: #990000;">sizeof</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$imglist</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//generate a random number between 0 and the number of images</span>
<span style="color: #000088;">$random</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mt_rand</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$no</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$image</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$imglist</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$random</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//display random swf</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;embed src=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$img_folder</span><span style="color: #339933;">.</span><span style="color: #000088;">$image</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; quality=&quot;high&quot;
pluginspage=&quot;http://www.macromedia.com/go/getflashplayer&quot;
type=&quot;application/x-shockwave-flash&quot; width=&quot;100&quot;
height=&quot;100&quot;&gt;&lt;/embed&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p><a href='http://www.phpmagicbook.com/wp-content/uploads/2008/06/random-swf-onload.rar' class="download">Random SWF On Page Load Script Download</a></p>
<p>If you want to display random image on page load called from a specific folder then change file extension from swf to jpg or gif or png in above code and replace embed code with image code as following. Adjust image size according to your need.</p>
<h4>Random Image Display Onload PHP Script</h4>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$imglist</span><span style="color: #339933;">=</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//$img_folder is the variable that holds the path to the swf files or images files.</span>
<span style="color: #666666; font-style: italic;">// see that you dont forget about the &quot;/&quot; at the end</span>
<span style="color: #000088;">$img_folder</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;images/&quot;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">mt_srand</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>double<span style="color: #009900;">&#41;</span><span style="color: #990000;">microtime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//use the directory class</span>
<span style="color: #000088;">$imgs</span> <span style="color: #339933;">=</span> <span style="color: #990000;">dir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$img_folder</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//read all files from the directory, ad them to a list</span>
<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$imgs</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">read</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">eregi</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;jpg&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #000088;">$imglist</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$file</span> &quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #990000;">closedir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$imgs</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//put all images into an array</span>
<span style="color: #000088;">$imglist</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$imglist</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$no</span> <span style="color: #339933;">=</span> <span style="color: #990000;">sizeof</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$imglist</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//generate a random number between 0 and the number of images</span>
<span style="color: #000088;">$random</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mt_rand</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$no</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$image</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$imglist</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$random</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//display random swf</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;img src=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$img_folder</span><span style="color: #339933;">.</span><span style="color: #000088;">$image</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; width=&quot;100&quot;
height=&quot;100&quot;&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p><a href="http://www.phpmagicbook.com/random-flash-swf-onload-php-script/">Random Flash SWF Onload PHP Script</a> is a post from: <a href="http://www.phpmagicbook.com">PHP Magic Book - Free PHP Scripts, Tutorials and Downloads</a></p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://www.phpmagicbook.com/dynamic-random-number/" title="Dynamic Random Number Generation Using PHP">Dynamic Random Number Generation Using PHP</a></li><li><a href="http://www.phpmagicbook.com/random-single-image-onload/" title="Random Single Image Onload Using PHP">Random Single Image Onload Using PHP</a></li><li><a href="http://www.phpmagicbook.com/random-single-image-display-on-page-reload/" title="Random Single Image Display On Page Reload Using PHP">Random Single Image Display On Page Reload Using PHP</a></li><li><a href="http://www.phpmagicbook.com/daily-changing-content-or-link-throughout-month/" title="Daily Changing Content Or Link Throughout Month">Daily Changing Content Or Link Throughout Month</a></li><li><a href="http://www.phpmagicbook.com/flash-php-mailing-form/" title="Flash PHP Mailing Form &#8211; Send Email from Flash Using PHP">Flash PHP Mailing Form &#8211; Send Email from Flash Using PHP</a></li><li><a href="http://www.phpmagicbook.com/php-flash-based-text-hit-counter/" title="PHP Flash Based Text Hit Counter &#8211; Flash Based Hit Counter Using PHP">PHP Flash Based Text Hit Counter &#8211; Flash Based Hit Counter Using PHP</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.phpmagicbook.com/random-flash-swf-onload-php-script/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Flash PHP Mailing Form &#8211; Send Email from Flash Using PHP</title>
		<link>http://www.phpmagicbook.com/flash-php-mailing-form/</link>
		<comments>http://www.phpmagicbook.com/flash-php-mailing-form/#comments</comments>
		<pubDate>Fri, 13 Jun 2008 06:50:40 +0000</pubDate>
		<dc:creator>Hiroshi</dc:creator>
				<category><![CDATA[Flash & PHP]]></category>
		<category><![CDATA[Mail]]></category>
		<category><![CDATA[email]]></category>

		<guid isPermaLink="false">http://www.phpmagicbook.com/?p=18</guid>
		<description><![CDATA[In this PHP tutorial we will learn that how to send email from flash using PHP. You will need: Flash file PHP email script Webhost to check the script Creating Flash File Create a movie clip and give it name i.e. form In that movie clip take single lined input text fields and give them [...]<p><a href="http://www.phpmagicbook.com/flash-php-mailing-form/">Flash PHP Mailing Form &#8211; Send Email from Flash Using PHP</a> is a post from: <a href="http://www.phpmagicbook.com">PHP Magic Book - Free PHP Scripts, Tutorials and Downloads</a></p>
]]></description>
			<content:encoded><![CDATA[<p>In this PHP tutorial we will learn that how to send email from flash using PHP. </p>
<p>You will need:</p>
<p>Flash file<br />
PHP email script<br />
Webhost to check the script</p>
<p><span id="more-151"></span></p>
<h4>Creating Flash File</h4>
<p>Create a movie clip and give it name i.e. <strong>form</strong></p>
<p>In that movie clip take single lined input text fields and give them name in Var: box. Take comments input text field and it must be multiple lined.</p>
<p>Place this action at form movie clip</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">onClipEvent</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">data</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">_root</span>.<span style="color: #0066CC;">nextFrame</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>And at submit button place this action</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">on</span> <span style="color: #66cc66;">&#40;</span>release<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
form.<span style="color: #0066CC;">loadVariables</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;email.php&quot;</span>, <span style="color: #ff0000;">&quot;POST&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>In next frame take a back button and apply this action at that</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">on</span> <span style="color: #66cc66;">&#40;</span>release<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">prevFrame</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>At the first frame where the form is, place stop action.</p>
<h4>Creating PHP File</h4>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// request variables</span>
<span style="color: #000088;">$email</span><span style="color: #339933;">=</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;email&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$name</span><span style="color: #339933;">=</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;name&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$company</span><span style="color: #339933;">=</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;company&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$phone</span><span style="color: #339933;">=</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;phone&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$comments</span><span style="color: #339933;">=</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;comments&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$subject</span><span style="color: #339933;">=</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;subject&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$myfrom</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$email</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$myemail</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;youemail@hotmail.com&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$todayis</span> <span style="color: #339933;">=</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;l, F j, Y, g:i a&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">;</span>
<span style="color: #000088;">$subject</span><span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Message From Website&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$message</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;
Date : <span style="color: #006699; font-weight: bold;">$todayis</span>
Name: : <span style="color: #006699; font-weight: bold;">$name</span>
company: : <span style="color: #006699; font-weight: bold;">$company</span>
phone: : <span style="color: #006699; font-weight: bold;">$phone</span>
email: : <span style="color: #006699; font-weight: bold;">$email</span>
comments : <span style="color: #006699; font-weight: bold;">$comments</span>
&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$from</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;From: <span style="color: #006699; font-weight: bold;">$myfrom</span><span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">mail</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$myemail</span><span style="color: #339933;">,</span> <span style="color: #000088;">$subject</span><span style="color: #339933;">,</span> <span style="color: #000088;">$message</span><span style="color: #339933;">,</span> <span style="color: #000088;">$from</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$subject2</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Thanks for contacting me.&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$message2</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Dear <span style="color: #006699; font-weight: bold;">$name</span>,
Thanks for contacting me, I will respond you shortly.&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$from2</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;From: <span style="color: #006699; font-weight: bold;">$myemail</span><span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">mail</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$email</span><span style="color: #339933;">,</span> <span style="color: #000088;">$subject2</span><span style="color: #339933;">,</span> <span style="color: #000088;">$message2</span><span style="color: #339933;">,</span> <span style="color: #000088;">$from2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p><a href='http://www.phpmagicbook.com/wp-content/uploads/2008/06/flashform.rar' class="download">Download Complete Script Example</a></p>
<p><a href="http://www.phpmagicbook.com/flash-php-mailing-form/">Flash PHP Mailing Form &#8211; Send Email from Flash Using PHP</a> is a post from: <a href="http://www.phpmagicbook.com">PHP Magic Book - Free PHP Scripts, Tutorials and Downloads</a></p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://www.phpmagicbook.com/random-flash-swf-onload-php-script/" title="Random Flash SWF Onload PHP Script">Random Flash SWF Onload PHP Script</a></li><li><a href="http://www.phpmagicbook.com/php-email-headers-and-multiple-recipients-html-php-email/" title="PHP eMail &#8211; Headers And Multiple Recipients &#8211; HTML PHP Email">PHP eMail &#8211; Headers And Multiple Recipients &#8211; HTML PHP Email</a></li><li><a href="http://www.phpmagicbook.com/easiest-way-ever-php-email/" title="Easiest Way Ever PHP eMail Script">Easiest Way Ever PHP eMail Script</a></li><li><a href="http://www.phpmagicbook.com/sending-email-with-php/" title="Sending eMail Using PHP">Sending eMail Using PHP</a></li><li><a href="http://www.phpmagicbook.com/php-flash-based-text-hit-counter/" title="PHP Flash Based Text Hit Counter &#8211; Flash Based Hit Counter Using PHP">PHP Flash Based Text Hit Counter &#8211; Flash Based Hit Counter Using PHP</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.phpmagicbook.com/flash-php-mailing-form/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Flash Based Text Hit Counter &#8211; Flash Based Hit Counter Using PHP</title>
		<link>http://www.phpmagicbook.com/php-flash-based-text-hit-counter/</link>
		<comments>http://www.phpmagicbook.com/php-flash-based-text-hit-counter/#comments</comments>
		<pubDate>Fri, 13 Jun 2008 06:38:12 +0000</pubDate>
		<dc:creator>Hiroshi</dc:creator>
				<category><![CDATA[Flash & PHP]]></category>
		<category><![CDATA[Hit Counter II]]></category>
		<category><![CDATA[No Database]]></category>
		<category><![CDATA[hit counter]]></category>

		<guid isPermaLink="false">http://www.phpmagicbook.com/?p=16</guid>
		<description><![CDATA[Lets create a hit counter in Flash which will store hits data using PHP script. Everytime when that flash file will be played online, it will update the hits data and display it in flash. In this script a blank text file count.txt is being used, and a php script file to store the hits [...]<p><a href="http://www.phpmagicbook.com/php-flash-based-text-hit-counter/">PHP Flash Based Text Hit Counter &#8211; Flash Based Hit Counter Using PHP</a> is a post from: <a href="http://www.phpmagicbook.com">PHP Magic Book - Free PHP Scripts, Tutorials and Downloads</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Lets create a hit counter in Flash which will store hits data using PHP script. Everytime when that flash file will be played online, it will update the hits data and display it in flash. In this script a blank text file <strong>count.txt</strong> is being used, and a php script file to store the hits data. Take a dynamic text field in flash movie and name it <strong>count</strong> and you are done. Name the flash movie <strong>counter.swf</strong></p>
<p><span id="more-150"></span></p>
<h4>PHP File Code (counter.php)</h4>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #666666; font-style: italic;">//Reading the file</span>
<span style="color: #000088;">$count</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;count.txt&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Increasing the count</span>
<span style="color: #000088;">$count</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;=&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$count</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$count</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$count</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Writing to file</span>
<span style="color: #000088;">$file</span> <span style="color: #339933;">=</span> <span style="color: #990000;">fopen</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;count.txt&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;w+&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">fwrite</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;count=&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$count</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">fclose</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Returning the count</span>
<span style="color: #b1b100;">print</span> <span style="color: #0000ff;">&quot;count=&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$count</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h4>Flah Movie Dynamic Text Field Count Scripting</h4>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">this<span style="color: #339933;">.</span>loadVariables<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;counter.php&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><a href='http://www.phpmagicbook.com/wp-content/uploads/2008/06/flashcounter.rar' class="download">Download File</a></p>
<p><a href="http://www.phpmagicbook.com/php-flash-based-text-hit-counter/">PHP Flash Based Text Hit Counter &#8211; Flash Based Hit Counter Using PHP</a> is a post from: <a href="http://www.phpmagicbook.com">PHP Magic Book - Free PHP Scripts, Tutorials and Downloads</a></p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li><a href="http://www.phpmagicbook.com/random-flash-swf-onload-php-script/" title="Random Flash SWF Onload PHP Script">Random Flash SWF Onload PHP Script</a></li><li><a href="http://www.phpmagicbook.com/flash-php-mailing-form/" title="Flash PHP Mailing Form &#8211; Send Email from Flash Using PHP">Flash PHP Mailing Form &#8211; Send Email from Flash Using PHP</a></li><li><a href="http://www.phpmagicbook.com/unique-php-hit-counter/" title="PHP Unique Hit Counter Script">PHP Unique Hit Counter Script</a></li><li><a href="http://www.phpmagicbook.com/simple-text-based-hit-counter-for-static-html-pages/" title="Simple Text Based Hit Counter For Static HTML Pages">Simple Text Based Hit Counter For Static HTML Pages</a></li><li><a href="http://www.phpmagicbook.com/simple-text-file-hit-counter/" title="Simple Text File Based PHP Hit Counter">Simple Text File Based PHP Hit Counter</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.phpmagicbook.com/php-flash-based-text-hit-counter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
