form to file using php

I want to send info input on form to a file; would appreciate any help you can give me. Thanks

[code]

Ladies Golf @charset "UTF-8"; /* CSS Document */ body { background-color:#305d04; margin:auto;

}

SHAGANNAPPI LADIES Golf Sign Up

		<form action="newform.php"  method="post" accept-charset="utf-8" class="golf_signup_form">
       
        
<font color="#FF0000">
		

		
		<div><label for="name"> Name</label><input type="text" id="Name" name="Name" size="50" maxlength="150">
		<div><label for="email">Email</label><input type="text" id="email" name="email]" size="50" maxlength="150">
Date: Please use drop down to pick a date Please pick a date: Tuesday, July 9, 2013 Tuesday, July 17. 2013
		<br />
		<div><label for="walking_flag">Cart or Walking</label><br />
        <input type="radio" id="cart_walking_flag" name="cart_walking_flag" value="1">
        <label for="cart_walking_flag-1">Cart 9</label>&nbsp;&nbsp;&nbsp;
      <input type="radio" id="cart_walking_flag-1" name="cart_walking_flag" value="1">  
       <label for="cart_walking_flag-1">Cart 18</label>&nbsp;&nbsp;&nbsp;
        <input type="radio" id="cart_walking_flag-2" name="cart_walking_flag" value="2">
        <label for="cart_walking_flag-2">Walking</label>
</center>	
/code]

[php]

New Form <?php // Get the name they entered in the form // We'll be naming the file this $file = $_POST['name'];

// We want the file to be a text file right?
$ex = “.txt”;
// Try to open a file named $file$ex
// Because this file doesn’t exist yet the server creates it
$write = fopen("$file$ex",“w”);

// MAKE SURE you close the file!!!
fclose($write);
// The folder that this script is in on the server is where the file we just made was saved

// Now put it all together:
/* Redirect to a different page in the current directory that was requested */
$host = $_SERVER[‘HTTP_HOST’];
$uri = rtrim(dirname($_SERVER[‘PHP_SELF’]), ‘/\’);
$extra = ‘newform.php’;
//header(“Location: http://$host$uri/$extra”);
//header(“Location: http://www.shagladiesgolf.ca/newform.txt/”);
exit;
?>

/php][/code]
Sponsor our Newsletter | Privacy Policy | Terms of Service