Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /* Customise These Values */
- $name = 1; //set to 1 to show name field, 0 to hide name field
- $name = $_REQUEST['name'];
- $successMessage = '<h4>Thank you for your registration</h4><p>We will contact you again shortly with more information closer to the time of the party.</p>';
- $exportPass = 'password'; //change this to something more secure
- /* Delete This */
- $_REQUEST['pass']=$exportPass;
- /* End Delete */
- if($_REQUEST['export']=='true'&&$_REQUEST['pass']==$exportPass){
- $file='data.csv';
- header("Content-type: application/force-download");
- header("Content-Transfer-Encoding: Binary");
- header("Content-length: ".filesize($file));
- header("Content-disposition: attachment; filename=\"".basename($file)."\"");
- header("Expires: ".gmdate("D, d M Y H:i:s")." GMT");
- header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
- header("Cache-Control: no-cache, must-revalidate");
- header("Pragma: nocache");
- readfile("$file");
- }else{
- ?>
- <!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>
- <title>Shire</title>
- <script src="http://code.jquery.com/jquery-latest.js"></script>
- <script src="js/jquery.bxSlider.min.js" type="text/javascript"></script>
- <script type="text/javascript">$(function(){$('#slider').bxSlider({auto:true,pager:true});});</script>
- <script type="text/javascript" src="fancybox/jquery.fancybox-1.3.4.pack.js"></script>
- <link rel="stylesheet" type="text/css" href="fancybox/jquery.fancybox-1.3.4.css" media="screen" />
- <link rel="stylesheet" type="text/css" href="css/style.css" media="screen" />
- <link rel="stylesheet" type="text/css" href="css/form.css" media="screen" />
- <script type="text/javascript">$(document).ready(function() {$(".menu, .dresscode, .entertainment, .coaches, .car, .train, .hamptoncourt").fancybox({'width':880,'height':670,'autoScale':false,'transitionIn':'fade','transitionOut':'fade','type':'iframe'});});</script>
- <script language="javascript">
- $(document).ready(function(){
- $("form#register").submit(function(){
- var email = $("input#email").val();
- var name = $("input#name").val();
- var attendance $( ".attendance" ).each( function()
- {
- if( this.checked == true )
- {
- attendance = this.value
- break
- }
- });
- if (email==""||email=="Email")
- {
- $('#nameInput').append("<p class='required'>required</p>");
- document.register.email.value='Name';
- $('#emailInput').append("<p class='required'>required</p>");
- document.register.name.value='Email';
- return false;
- }else if(email.indexOf("@") < 1){ // very basic check if email address entered is valid
- $('#emailInput').append("<p class='required'>invalid</p>"); //could have a different image for invalid input
- document.register.email.focus(); //could be used to focus on email field
- $('#nameInput').append("<p class='required'>invalid</p>"); //could have a different image for invalid input
- document.register.name.focus();
- return false;
- }else{
- var sendData = 'email='+ email + '&name=' + name + '&attendance=' + attendance;
- $.ajax({
- type: "POST",
- url: "submit.php",
- data: sendData,
- success: function() {
- $('#right').html("<div id='submitted'></div>");
- $('#submitted').html("<?php echo $successMessage;?>")
- .hide()
- .fadeIn(1000, function() {
- });
- }
- });
- return false;
- }
- });
- });
- </script>
- </head>
- <body>
- <?php if($_REQUEST['pass']==$exportPass){ ?>
- <div style="position:absolute; top:10px; left:10px; z-index:99; color:#000;">
- <a href="index.php?export=true&pass=<?php echo $exportPass; ?>&time=<?php echo time(); ?>">Export registrations</a>
- </div>
- <?php }?>
- <div id="container">
- <div id="slider">
- <div class="slide"><img src="images/slider-1.gif" width="652" height="165" /></div>
- <div class="slide"><img src="images/slider-2.gif" width="652" height="165" /></div>
- <div class="slide"><img src="images/slider-3.gif" width="652" height="165" /></div>
- <div class="slide"><img src="images/slider-4.gif" width="652" height="165" /></div>
- <div class="slide"><img src="images/slider-5.gif" width="652" height="165" /></div>
- </div>
- <div id="leftcol">
- <h1>Shire's Annual Party 2011</h1>
- <p>This year, we are excited to be hosting the Shire Annual Party in
- the sumptuous surroundings of Hampton Court Palace.</p>
- <p class="sand">At this stage please use the form below to let us know whether you are able to attend, further information can be found by clicking on
- the buttons to the right.</p>
- <p class="sand"> If you are able to attend you will be sent a further mail with a link through to a page so we can capture all your requirements eg. dietary, transport options etc.
- </p>
- <div id="registration">
- <h2>Registration Form</h2>
- <div id="right">
- <form id="register" name="register" method="post" action="submit.php">
- <p>Are you able to attend?<br />
- <label>
- <input type="radio" name="attendance" value="Yes" class="attendance" />
- Yes</label>
- <label>
- <input type="radio" name="attendance" value="No" class="attendance" />
- No</label>
- </label>
- </p>
- <div id="nameInput" class="fromrelative">
- <input name="name" id="name" type="text" value="Enter your name" class="textBox" maxlength="54" onfocus="if(this.value=='Enter your name')this.value='';" />
- </div>
- <div id="emailInput" class="fromrelative">
- <input name="email" id="email" type="text" value="Enter your Shire email address" class="textBox" maxlength="54" onfocus="if(this.value=='Enter your Shire email address')this.value='';" />
- </div>
- <input name="Submit" type="submit" value="" class="submit" />
- </form>
- </div>
- </div>
- </div>
- <div id="rightcol">
- <h2>Useful Information</h2>
- <ul>
- <li><a href="menu.html" class="menu">Menu</a></li>
- <li><a href="dresscode.html" class="dresscode">Dress Code</a></li>
- <li><a href="entertainment.html" class="entertainment">Entertainment</a></li>
- <li><a href="coaches.html" class="coaches">Free Coaches</a></li>
- <li><a href="car.html" class="car">Directions by Car</a></li>
- <li><a href="train.html" class="train">Directions by Train</a></li>
- <li><a href="hamptoncourt.html" class="hamptoncourt">Hampton Court</a></li>
- </ul>
- <br /><br />
- <script language="JavaScript" src="audio/audio-player.js"></script>
- <object type="application/x-shockwave-flash" data="audio/player.swf" id="audioplayer1" height="24" width="170">
- <param name="movie" value="audio/player.swf">
- <param name="FlashVars" value="playerID=audioplayer1&bg=0xf9deaf&leftbg=0xfce9cb&
- lefticon=0xb18451&rightbg=0xfce9cb&rightbghover=0x999999&righticon=0xb18451&righticonhover=0xffffff&text=0xb18451&slider=0x666666&track=0xFFFFFF&border=0xf9deaf&loader=0xb18451&loop=yes&autostart=yes&soundFile=audio/music.mp3">
- <param name="quality" value="high">
- <param name="menu" value="false">
- <param name="wmode" value="transparent">
- </object>
- </div>
- </div>
- </body>
- </html>
- <?php
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement