There is an HTML page code:
& lt; form id = "form" action = "act.html" method = "post" target = "_blank" & gt;
& lt; input type = "text" name = "txt" value = "777" & gt;
& lt; input type = "submit" value = "Submit" & gt;
& lt; / form & gt;
As you can see, the form is submitting data to the file ‘act.html’. Here is the content of the ‘act.html’ file:
& lt; span style = "color: red;" name = "txt" & gt; & lt; / span & gt;
How to submit this form without using PHP? If possible, how much more difficult is it? If it’s easy to do, then tell me how.
Answer 1, authority 100%
& lt; form id = "form" action = "act.html" method = "get" target = "_ blank "& gt;
& lt; input type = "text" name = "txt" value = "777" & gt;
& lt; input type = "submit" value = "Submit" & gt;
& lt; / form & gt;
act.html
& lt; html & gt;
& lt; head & gt;
& lt; script & gt;
function loaddata () {
var tmp = new Array (); // two auxiliary
var tmp2 = new Array (); // array
get = new Array ();
var url = location.search; // GET request string
if (url! = '') {
tmp = (url.substr (1)). split ('& amp;'); // separate variables
for (var i = 0; i & lt; tmp.length; i ++) {
tmp2 = tmp [i] .split ('='); // get array will contain
get [tmp2 [0]] = tmp2 [1]; // pairs key (variable name) - & gt; value
}
}
// then fill in everything we need with data from the get array
document.getElementById ("txt"). innerHTML = get ['txt'];
}
& lt; / script & gt;
& lt; / head & gt;
& lt; body onLoad = 'loaddata ()' & gt;
& lt; span style = "color: red;" name = "txt" id = "txt" & gt; & lt; / span & gt;
& lt; / body & gt;
& lt; / html & gt;
Answer 2, authority 99%
Option 1: we only use GET requests, we get the parameters via JavaScript (How to retrieve GET parameters from javascript? )
Option 2: we use a server-side programming language. There are actually a lot of them, choose according to your taste (PHP, Node.JS, .NET, Java, Python, Perl, Scala …)