hi

i have a simple form with 4 radio buttons in index.php .
if the user selects any radio button and click on the submit button then he will downloaded the corresponding .swf file associated with that radio buttons in next page as download.php.

what ever the option is selected from the radio buttons the downloading is done in same download.php page.but this is not the correct one.

by doing the above functionality:

i am getting the url as:
http://localhost/download.php and the corresponding file is downloaded.


Actually i want the urls will be of the selected .swf name.

ex:

http://localhost/swf_filename1.php
http://localhost/swf_filename2.php
http://localhost/swf_filename3.php
http://localhost/swf_filename4.php

instead of getting the http://localhost/download.php.


inorder to get a clear idea about my requirement i ahve attached my code .

pls go through that. and help me.


thanks

Attachments
<?php
//print_r($_POST);exit;
$download=$_POST['download'];
$name=$_POST['name'];
$comments=$_POST['comments'];

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


				  
                 $message=$message."<br><br>Regards<br>$name";
				 
			     //echo $message;
			     // exit;
                 //headers
					
					
                 $headers="MIME-Version: 1.0"."\r\n";
                 $headers.="From:$email\r\n";
                 $headers.="Content-type: text/html "."\r\n";
				 
                 //$to="nakka.lavanya@gmail.com";   
                 $to="realestatemarketingexplained@gmail.com";   
                  
			     //mail
                 mail($to,$subject,$message,$headers);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Scott Jackson's REAL ESTATE MARKETING</title>
<link href="style.css" rel="stylesheet" type="text/css"/>
<style type="text/css">
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-position:top;
	background-image: url(images/background.png);
	background-repeat:repeat-x;
}
</style>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
</head>

<body>
<table width="100%" height="0" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center" valign="top" style="padding-top:50px"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td align="center" valign="top">
		<?php
		$file=$download.".swf";
		?>
          <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="640" height="498">
            <param name="movie" value="<?=$file?>" />
            <param name="quality" value="high" />
            <embed src="<?=$file?>" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="640" height="498"></embed>
        </object></td>
      </tr>
      <tr>
        <td align="center" valign="middle" class="optintext" style="height:50px;">Let me know what
you think.</td>
      </tr>
      <tr>
        <td align="left" valign="top"><table width="640" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td align="left" valign="top" style="padding-top:10px;">
			<form id="form1" name="form1" method="post" action="option_mail.php">
                      <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                        <tr>
                          <td align="right" valign="top" class="mailtxt" style="width:150px; height:30px; padding-left:10px;">
						  Enter Your    Name :						  </td>
                          <td align="left" valign="top" style="padding-left:5px;"><input name="name" type="text" class="text2" size="28" id="name"/></td>
                        </tr>
                        <tr>
                          <td align="right" valign="top" class="mailtxt" style="width:150px; height:30px; padding-left:10px;">Comments : </td>
                          <td align="left" valign="top"   style="padding-left:5px;">
						    <textarea name="comments" cols="30" rows="6" class="text2"></textarea>						  </td>
                        </tr>
                        <tr>
                          <td align="right" valign="top" class="mailtxt" style="width:150px; height:30px; padding-left:10px;">&nbsp;</td>
                          <td align="left" valign="top"   style="padding-left:5px;"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                            <tr>
                              <td align="left" valign="top" style="width:70px; padding-top:5px;">
                                <input name="Submit" type="submit" class="mailtxt" value="Post" /> 
							  </td>
                              <td align="left" valign="top">&nbsp;</td>
                            </tr>
                          </table></td>
                        </tr>
                        <tr>
                          <td align="right" valign="top" class="mailtxt" style="width:150px; height:20px; padding-left:10px;">&nbsp;</td>
                          <td align="left" valign="top" style="padding-left:5px;">&nbsp;</td>
                        </tr>
                      </table>
                  </form>
				  </td>
          </tr>
          <tr>
            <td align="left" valign="top" style="height:5px;"></td>
          </tr>
          <tr>
            <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2">
              <tr>
                <td class="footer"><table width="100%" border="0" cellspacing="0" cellpadding="2">
                    <tr>
                      <td align="center" valign="middle" class="text4">&nbsp;Copyright &copy; 2007 Real Estate Marketing Explained All rights reserved.</td>
                    </tr>
                </table></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td align="left" valign="top">&nbsp;</td>
      </tr>
      
      </table>
	 </td>
    </tr>
             </table>
			 </td>
              </tr>
              
            </table></td>
          </tr>
        </table>
        </td>
      </tr>
    </table></td>
  </tr>
</table>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Scott Jackson's REAL ESTATE MARKETING</title>
<link href="style.css" rel="stylesheet" type="text/css"/>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-position:top;
	background-image: url(images/background.png);
	background-repeat:repeat-x;
}

-->
</style>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
</head>
<body>
<table width="100%" height="0" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center" valign="top" style="padding-top:50px"><table width="735" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><img src="images/header2b.png" width="735" height="204" /></td>
      </tr>
      <tr>
        <td style="height:25px;"></td>
      </tr>
      <tr>
        <td align="left" valign="top" style="padding-left:25px; padding-right:25px; MARGIN-BOTTOM: -3px; padding-bottom:25px; LINE-HEIGHT: 100%" class="border"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td><p class="h1">&ldquo;They all looked at me like I was CRAZY when my broker announced at the office meeting my  goal was to close 10 Million Dollars  in sales......&rdquo;</p>
              <p class="h1">&ldquo;But when I was named AGENT OF THE YEAR out of 300  other agents and MADE $202,167.23 12 months later, at only 21 years old, they  all wanted to know the secrets of how I did it.&rdquo;</p>                           </td>
          </tr>
          <tr>
            <td align="center" valign="top" style="padding:10px 0px;"><script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0','width','80','height','25','title','realestate','src','audio_final','quality','high','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','audio_final' ); //end AC code
</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="80" height="25" title="realestate">
              <param name="movie" value="audio_final.swf" />
              <param name="quality" value="high" />
              <embed src="audio_final.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="80" height="25"></embed>
            </object></noscript></td>
          </tr>
          <tr>
            <td><span class="text">From:</span> <span class="text2">Scott Jackson</span></td>
          </tr>
          <tr>
            <td><span class="text">Re: </span><span class="text2">Real Estate Marketing Explained</span></td>
          </tr>
          <tr>
            <td align="left" valign="top" style="height:15px;"></td>
          </tr>
          <tr>
            <td align="left" valign="top" class="text">* Would you like to  know how to get warm prospects to call you first?</td>
          </tr>
          <tr>
            <td align="left" valign="top" class="text2">* Do you feel there is a better way to earn a great living  in your real estate business?</td>
          </tr>
          <tr>
            <td align="left" valign="top" class="text">* Have the marketing ideas you received in the past not given you the results you desired?</td>
          </tr>
          <tr>
            <td align="left" valign="top" class="text2">* Are you finally ready to learn from someone who has experienced the success you deserve?</td>
          </tr>
          <tr>
            <td align="left" valign="top" style="height:15px;"></td>
          </tr>
          <tr>
            <td align="left" valign="top" class="text2">If you were able to answer yes, then this page is what you&rsquo;ve been waiting for.&nbsp;The curtain will be pulled away and you&rsquo;ll truly see the secrets to building a profitable real estate business.</td>
          </tr>
          <tr>
            <td align="left" valign="top" style="height:20px;"></td>
          </tr>
          <tr>
            <td align="center" valign="top" class="h1">Claim Your <span class="text5">FREE</span> Real Estate Marketing Explained Video's!</td>
          </tr>
          <tr>
            <td align="left" valign="top" style="height:20px;"></td>
          </tr>
          <tr>
            <td align="left" valign="top"><table width="520"  border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td align="center" valign="top" class="inpagestrip" style="padding-left:30px; padding-right:30px">
				<form name="form" method="post" action="download_video.php" onsubmit="return validate_form(this);">
				<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="download" /></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="download"/></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="download" /></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="USPS FLASH" id="download"/></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="download"/></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>
				</td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td><table width="100%" border="0" cellspacing="0" cellpadding="2">
              <tr>
                <td class="footer"><table width="100%" border="0" cellspacing="0" cellpadding="2">
                    <tr>
                      <td align="center" valign="middle" class="text4">Copyright &copy; 2007 Real Estate Marketing Explained All rights reserved.</td>
                    </tr>
                </table></

This is an easy one.

Just create a "dispatch" PHP script that acts as proxy for the download requests. Here is a sample code:

<form method="post">
<input type="radio" name="file" value="swf_filename1" checked="checked" />
<input type="radio" name="file" value="swf_filename2" />
<input type="radio" name="file" value="swf_filename3" />
<input type="radio" name="file" value="swf_filename4" />
<input type="submit" value="Download" />
</form>
<?php
if (isset($_POST['file'])) {
	$valid = array('swf_filename1', 'swf_filename2', 'swf_filename3', 'swf_filename4');
	if (in_array($_POST['file'], $valid)) {
	   include($_POST['file'] . '.php');
	} else {
		print('File Not Found');
	}
}
?>
This article has been dead for over six months. Start a new discussion instead.