1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

swf video file downloading in php

Discussion in 'PHP' started by padma525, Jun 3, 2008.

  1. padma525

    padma525 New 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........:worried:

    for that i have devloped the code as shown below.


    HTML code:
    -------------------
    HTML:
    <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:

    <?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 a moderator: Jun 4, 2008
  2. pradeep

    pradeep Team Leader

    What do you mean by file is not downloading properly?? Please let us know the exact problem!
     
  3. padma525

    padma525 New 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
     
  4. pradeep

    pradeep Team Leader

    Windows media player does not support SWF play by default, thats why the message!
     
  5. padma525

    padma525 New Member

    Thanks for your Replies.

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

    pls suggest me.
     
  6. pradeep

    pradeep Team Leader

    install flash.
     

Share This Page