Install Php and Uhttpd

nano /www/saveinput.php
<?php
$file = 'people.html';
// Open the file to get existing content
$current = file_get_contents($file);
// Append a new person to the file
$current .=$_GET["name"]."\n";
//$current .= "John Smith\n";
// Write the contents back to the file
file_put_contents($file, $current);
echo "data saved";
?>
<p><a href="/people.html">View Result</a></p>
<p><a href="/inputform.html">Input More</a></p>
touch /www/people.html
nano  /www/inputform.html
<!DOCTYPE html>
<html>
<body>
<form action="saveinput.php" method="get" target="_blank">
  Name: <input type="text" name="name"><br>
  <input type="submit" value="Submit">
</form>
<p>Click on the submit button, and the input will be sent to a page on the server called "saveinput.php".</p>
<p>
<a href="/people.html">View Result</a></p>
</body>
</html>

open "http://192.168.0.102/inputform.html"  to input data.

 

 

Comments powered by CComment