Guest User

Untitled

a guest
Sep 19th, 2011
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.56 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <link href="style.css" rel="stylesheet" type="text/css" />
  5. <?php
  6. $successMessage = '<h1>Thank you for your registration</h1><p>We will contact you with more information closer to the time of the party.</p>';
  7.                                                                            
  8. ?>
  9. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  10. <title>Beta Splash Page</title>
  11. </head>
  12.  
  13. <body>
  14.  
  15.  
  16. <!--main div start -->
  17.         <div id="mainDiv" class="emailForm3Bg">
  18.             <!--opacity part start -->
  19.                 <div class="opacityDiv">
  20.                    
  21. <?php
  22. $file = 'data.csv';
  23. $name = $_REQUEST['name'];
  24. $attendance = $_REQUEST['attendance'];
  25. $email = $_REQUEST['email'];
  26. $additional = array($attendance,$name,$email);
  27.  
  28. if($email!=""&&$email!="Email"){
  29.     $fp = fopen($file, 'a');
  30.     fputcsv($fp, $additional, ',');
  31.     fclose($fp);
  32.     chmod($file,0600);
  33.     echo $successMessage;
  34. }else{
  35.     ?> <h1>Sorry!</h1><p>Your email address is required. <a href="index.php">Click here to go back</a></p><?php
  36. }?>
  37.                   </div>
  38.  
  39.                     <!--right part end -->
  40.                     <br class="spacer" />
  41.                 </div>
  42.             <!--opacity part end -->
  43.         </div>
  44.     <!--main div end -->
  45. </body>
  46. </html>
  47.  
  48.  
  49. <?php
  50.  
  51. /*function fputcsv($fp, $arr, $del=",", $enc="\"") {
  52.     fwrite($fp, (count($arr)) ? $enc . implode("{$enc}{$del}{$enc}", str_replace("\"", "\"\"", $arr)) . $enc . "\n" : "\n");
  53. } */
  54. ?>
Add Comment
Please, Sign In to add comment