All pastes #825918 Raw Edit

to add multiple content types

public text v1 · immutable
#825918 ·published 2007-12-20 22:03 UTC
rendered paste body
<!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" />

<link rel="stylesheet" type="text/css"
href="stylesheet.css" />
<title>Khalsa Kids</title>
<style>
a {
	color: #000000;
}
a:visited {
	color: 550202;
	text-decoration: none;
}
a:hover {
	color: 000000;
	text-decoration: underline;
}
a:active {
	color: 000000;
	text-decoration: none;
}
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-bottom: 0px;
}
a:link {
	color: 550202;
	text-decoration: none;
}

</style>
<script type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>

<body onload="MM_preloadImages('images/navbar_side_roll_03.gif','images/navbar_side_roll_05.gif','images/navbar_side_roll_07.gif','images/navbar_side_roll_09.gif','images/navbar_side_roll_11.gif','images/navbar_side_roll_13.gif','images/navbar_side_roll_15.gif','images/navbar_side_roll_17.gif')">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="320" height="100%" align="left" valign="top"><table width="800" height="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="127" height="100%" align="left" valign="top" background="images/navbar_side_20.gif">
		<?php include("sidenav.php"); ?>
		</td>
        <td height="100%" align="left" valign="top"><table width="673"  border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td align="left" valign="top"><table width="673" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="250" align="left" valign="top"><img src="images/page_top.gif" width="250" height="73" /></td>
                <td align="left" valign="bottom"><img src="images/yourstory_header.gif" width="285" height="68" /></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td align="left" valign="top"><table width="673" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="13" height="100%" align="left" valign="top" background="images/page_side.gif"><img src="images/spacer.gif" width="13" height="10" /></td>
                <td height="100%" align="left" valign="top"><table width="660" border="0" cellspacing="0" cellpadding="0">
                  
                  <tr>
                    <td align="left" valign="top"><table width="660" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td width="10" align="left" valign="top"><img src="images/spacer.gif" width="10" height="10" /></td>
                        <td align="left" valign="top">





<table width="640" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td align="left" valign="top"><img src="images/expert_shell_01.gif" width="640" height="25" /></td>
                          </tr>
                          <tr>
                            <td align="left" valign="top"><table width="640" border="0" cellspacing="0" cellpadding="0">
                              <tr>
                                <td width="2" align="left" valign="top" bgcolor="#000000"><img src="images/spacer.gif" width="2" height="10" /></td>
                                <td width="10" align="left" valign="top" background="images/expert_shell_03.gif"><img src="images/spacer.gif" width="10" height="10" /></td>
                                <td align="left" valign="top" background="images/expert_shell_03.gif"><table width="616" border="0" cellspacing="0" cellpadding="0">
                                  <tr>
                                    <td><span class="style2">Have you done something recently to stand up for your rights? Do you have an inspiring story to tell other Sikhs? Would you like to serve as a role model for Sikh youth? If you think so, tell us about it here, and we may feature your story on Khalsa Kids' "You're Not the Only One" page. Your story can be used to help other Sikhs around the world.</span></td>
                                  </tr>
                                  <tr>
                                    <td><img src="images/spacer.gif" width="10" height="10" /></td>
                                  </tr>
                                  <tr>
                                    <td bgcolor="#000000"><img src="images/spacer.gif" width="10" height="3" /></td>
                                  </tr>
                                  <tr>
                                    <td><img src="images/spacer.gif" width="10" height="10" /></td>
                                  </tr>
                                </table>
                                 </td>
                                <td width="10" align="left" valign="top" background="images/expert_shell_03.gif"><img src="images/spacer.gif" width="10" height="10" /></td>
                                <td width="2" align="left" valign="top" bgcolor="#000000"><img src="images/spacer.gif" width="2" height="10" /></td>
                              </tr>
                            </table></td>
                          </tr>
                          <tr>
                            <td align="left" valign="top"><table width="640" border="0" cellspacing="0" cellpadding="0">
                              <tr>
                                <td><table width="640" border="0" cellspacing="0" cellpadding="0">
                                  <tr>
                                    <td width="2" align="left" valign="bottom" bgcolor="#000000"><img src="images/expert_shell_05_left.gif" width="2"  /></td>
                                    <td width="10" align="left" valign="bottom" background="images/expert_shell_03.gif"><img src="images/expert_shell_05_left2.gif" width="10" /></td>
                                    <td align="left" valign="top" background="images/expert_shell_03.gif">
                                        <?php
$db=mysql_connect('p50mysql69.secureserver.net','khalsauploads','Vide0Upload');
mysql_select_db('khalsauploads');

if(isset($_POST['sub_upload'])){

	//grab the location of our file and pull in its binary data
	//then push that out into a database table

	echo '<p class="style1">Thanks for Telling Us Your Story. We will get back in touch with you or your parents if we decided to feature your story on our site.</p>
                                      <p class="style1">In the meantime you can check out some other things on our site here:</p>
                                      <p class="style1"><a href="explaining.php"><img src="images/morelinks_explaining.gif" width="185" height="50" border="0" /></a><a href="knowyourrights.php"><img src="images/morelinks_know.gif" width="185" height="50" border="0" /></a><a href="links.php"><img src="images/morelinks_links.gif" width="185" height="50" border="0" /></a></br></br><p class="style1">Or you can submit another story and video right now.  Just do not forget to include all your information agian.</p></br></br> <table width="615" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                      <td><img src="images/spacer.gif" width="10" height="10" /></td>
                                    </tr>
                                    <tr>
                                      <td height="2" bgcolor="#000000"><img src="images/spacer.gif" width="10" height="2" /></td>
                                    </tr>
                                    <tr>
                                      <td><img src="images/spacer.gif" width="10" height="10" /></td>
                                    </tr>
                                  </table>';
	$data=file_get_contents($_FILES['myfile']['tmp_name']);
	$name=$_FILES['myfile']['name'];
	$sql="INSERT INTO upload_test (title,email,parentname,parentemail,city,state,text,videourl,file_data,file_name) VALUES
	('".$_POST['my_name']."','".$_POST['email']."','".$_POST['parentname']."','".$_POST['parentemail']."','".$_POST['city']."','".$_POST['state']."','".$_POST['text']."','".$_POST['videourl']."','".addslashes($data)."','".$name."')";
	mysql_query($sql) or die('Error: '.mysql_error());
}

if(isset($_GET['id'])){
       $sql='SELECT * FROM upload_test where id=\''.$_GET['id'].'\'';
       $query=mysql_query($sql) or die('Error: '.mysql_error());

       $row=mysql_fetch_assoc($query); //print_r($row);

       header('Content-type: video/quicktime');
       header('Content-length: '.strlen($row['file_data']));
       header('Content-Disposition: attachment; filename='.$row['file_name']);
	   echo $row['file_data'];
}else{
?>
<form action="<?=$_SERVER['PHP_SELF']?>" method="POST" enctype="multipart/form-data">
                                        <table width="616" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="300" align="left" valign="top"><span class="style1">Your Name<br />
                                          <input type="text" name="my_name" size="30"/>
                                          <br /><br />
                                          Your Email<br />
                                          <input type="text" name="email" size="30"/>
                                          <br /><br />
										  Parents Name<br />
                                          <input name="parentname" size="30" value="" />
                                          <br /><br />
										  Parents Email<br />
                                          <input name="parentemail" size="30" value="" />
                                          <br /><br />
										   City<br />
                                          <input name="city" size="30" value="" />
                                          <br /><br />
										  State<br />
                                          <input name="state" size="30" value="" />
                                          <br /><br /></span></td>
    <td width="20" align="left" valign="top"><img src="images/spacer.gif" width="20" height="10" /></td>
    <td width="313" align="left" valign="top"><span class="style1">Your Story <br />
                                          <textarea name="text" cols="35" rows="14"></textarea>
                                          <br />
                                          <br />
                                          Video (we only accept .mov files) <br />
                                          <input type="file" name="myfile" id="myfile"/>
										  <br />or enter Video Url<br />
                                          <input name="videourl" size="30" value="" />
                                          <br />
										  </span></td>
  </tr>
</table>
 
                                          <br />
                                          <span class="style1">Having trouble submitting your story here? Email us directly at<a href="mailto:khalsakids@sikhcoalition.org"> khalsakids@sikhcoalition.org</a>.</span><br />
                                          
                                          <img src="images/expert_shell_05_bottom.gif" /><input type="image" src="images/expert_shell_bottom2.gif" " onmouseover="MM_swapImage('images/expert_shell_bottom2_roll.gif',",'images/expert_shell_bottom2.gif',1);" onMouseOut="MM_swapImgRestore();" alt="submit"  name="sub_upload" value="upload" >
                                      </form><?php } ?></td>
                                    <td width="10" align="left" valign="bottom" background="images/expert_shell_03.gif"><img src="images/expert_shell_right2.gif" width="10"  /></td>
                                    <td width="2" align="right" valign="bottom" bgcolor="#000000"><img src="images/expert_shell_right.gif" width="2"  /></td>
                                  </tr>
                                </table></td>
                              </tr>
                              <tr>
                                <td align="left" valign="top"><img src="images/spacer.gif" width="10" height="20" /></td>
                              </tr>
                            </table></td>
                          </tr>
                        </table></td>
                        <td width="10" align="right" valign="top"><img src="images/spacer.gif" width="10" height="10" /></td>
                      </tr>
                    </table></td>
                  </tr>
                  <tr>
                    <td align="left" valign="top">&nbsp;</td>
                  </tr>
                  <tr>
                    <td></td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                  </tr>
                </table></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td align="left" valign="top"><table width="673" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="320" align="left" valign="bottom"><img src="images/page_bottom_02.gif" width="320" height="120" /></td>
                <td align="right" valign="bottom"><?php include("copyright.php"); ?></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td height="2" align="left" valign="top" background="images/navbar_side_20.gif"><img src="images/page_bottom_127.gif" width="127" height="2" /></td>
        <td height="2" align="left" valign="top"><img src="images/page_bottom_bigger.gif" width="317" height="2" /></td>
      </tr>
    </table>
</td>
  </tr>
</table>
</body>
</html>