Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 73905

Website user input post to a file in my pc

$
0
0

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);
}
?>

Viewing all articles
Browse latest Browse all 73905

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>