swf video file downloading in php

padma525's Avatar, Join Date: Jun 2008
Newbie Member
Hi,

i am new to this forum.

i have developed a page in that some radio buttons are there associcated with the values as .swf file names. if i clicked one radio button that corresponding swf file is going to be downloaded.and at the same time a mail will also go to the admin.

wat i facing the problem is that .swf video file is not downloading properly .mail will be going with out any problem.

pls help me........

for that i have devloped the code as shown below.


HTML code:
-------------------
HTML Code:
<form name="form" method="post" action="optionpage1.php">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="top">&nbsp;</td>
<tr>
<tr>
<td align="left" valign="top" class="text">Check the box of the video you would like to watch and get instant access on the very next page!</td>
</tr>
<tr>
<td align="left" valign="top">&nbsp;</td>
</tr>
<tr>
<td align="left" valign="top">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="top" style="width:30px; height:25px;"><input type="radio" name="download" value="direct_mail_campaigns_recorded" id="download1" /></td>
<td align="left" valign="top" class="text">Dominant Direct Mail Campaigns (take over the entire subdivision)</td>
</tr>
<tr>
<td align="left" valign="top" style="height:25px;"><input type="radio" name="download" value="Getting the Edge at Listing Appointments FLASH" id="download2"/></td>
<td align="left" valign="top" class="text">Getting the Edge at Listing Appointments</td>
</tr>
<tr>
<td align="left" valign="top" style="height:25px;"><input type="radio" name="download" value="Price Reductions FLASH" id="download3" /></td>
<td align="left" valign="top" class="text">Techniques for getting Price Reductions (get your listings sold!)</td>
</tr>
<tr>
<td align="left" valign="top" style="height:25px;"><input type="radio" name="download" value="USP'S FLASH" id="download4"/></td>
<td align="left" valign="top" class="text">Unique Selling Propositions (build a 100ft wall from your competition)</td>
</tr>
<tr>
<td align="left" valign="top" style="height:25px;"><input type="radio" name="download" value="Divorce Estate Attorneys FLASH" id="download5"/></td>
<td align="left" valign="top" class="text">Getting Divorce and Estate Attorneys to hand you highly motivated prospects</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left" valign="top" style="height:10px;"></td>
</tr>
<tr>
<td align="left" valign="top"> </td>
</tr>
<tr>
<td>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="right" valign="top" class="mailtxt" style="width:200px; height:25px;">Enter Your First Name :</td>
<td align="left" valign="top" style="padding-left:5px;"><input name="name" type="text" class="text2" size="25" /></td>
</tr>
<tr>
<td align="right" valign="top" class="mailtxt" style="width:200px; height:25px;">Type In Your E-mail Address : </td>
<td align="left" valign="top" style="padding-left:5px;"><input name="email" type="text" class="text2" size="25" /> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left" valign="top" style="height:10px;"></td>
</tr>
<tr>
<td align="center" valign="middle"><table width="0" border="0" align="center" cellpadding="2" cellspacing="0">
<tr>
<td bgcolor="#9f0000"><input name="Button" type="submit" class="h2" value="Claim Your FREE Videos Now!"/></td>
</tr>
</table></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>

</form>

php code:
---------------
PHP Code:

<?php
//print_r($_POST);exit;
$download=$_POST['download'];
$name=$_POST['name'];
$email=$_POST['email'];
//echo $download;
//echo $email;
if(($download!='')&&($email!=''))
{

$file $download;
header("Content-type: application/swf");
header("Content-Disposition: attachment; filename=".$file);
readfile($file);


$subject="Download video files details from Scott Jackson Real Estate Marketing";
$message="Dear Admin, <br><br> I have downloaded &nbsp;&nbsp;'$download'&nbsp;&nbsp; \t\t file.";

$message=$message."<br><br>Regards<br>$name";


$headers="MIME-Version: 1.0"."\r\n";
$headers.="From:$email\r\n";
$headers.="Content-type: text/html "."\r\n";

$to="aaa@yahoo.com";
mail($to,$subject,$message,$headers);

}

Last edited by shabbir; 4Jun2008 at 09:40.. Reason: Code block
pradeep's Avatar, Join Date: Apr 2005
Team Leader
What do you mean by file is not downloading properly?? Please let us know the exact problem!
padma525's Avatar, Join Date: Jun 2008
Newbie Member
i mean that i am opening that file in windows media player. at the time of opening it will be throwing an error like :

"Windows Media Player cannot play the file. The file is either corrupt or the Player does not support the format you are trying to play."

this is the problem i am getting. pls do the needful.



thanks
pradeep's Avatar, Join Date: Apr 2005
Team Leader
Windows media player does not support SWF play by default, thats why the message!
padma525's Avatar, Join Date: Jun 2008
Newbie Member
Thanks for your Replies.

is there any possible ways to open that .swf video files other than Windows media player.

pls suggest me.
pradeep's Avatar, Join Date: Apr 2005
Team Leader
install flash.