Need help with a php program...cant find the problem This is the code i came up with...i just have multiple user inputs and i need the php code to put those inputs in a file.
<?php
if(isset($_POST['submit']))
{
$name = $_POST['name'];
$discord = $_POST['discord'];
$adress = $_POST['adress'];
$age = $_POST['age'];
$W1 = $_POST['W1'];
$W2 = $_POST['W2'];
$W3 = $_POST['W3'];
$file = fopen("userinput.txt","a+") or die ("file not open");
$s = $name. "," .$discord."," .$adress."," .$age."," .$W1."," .$W2."," .$W3.",\n";
fputs($file,$s) or die ("Data not write");
fclose($file);
}
?><?php
if(isset($_POST['submit']))
{
$name = $_POST['name'];
$discord = $_POST['discord'];
$adress = $_POST['adress'];
$age = $_POST['age'];
$W1 = $_POST['W1'];
$W2 = $_POST['W2'];
$W3 = $_POST['W3'];
$file = fopen("userinput.txt","a+") or die ("file not open");
$s = $name. "," .$discord."," .$adress."," .$age."," .$W1."," .$W2."," .$W3.",\n";
fputs($file,$s) or die ("Data not write");
fclose($file);
}
?>