I have a html file that titled test.html
this is the file:
<!DOCTYPE html>
<html>
<body onload="document.getElementById('saveForm').click();">
<form method="post" enctype="multipart-form-data" name="my_form" onsubmit="clearTextBoxCounter()" action="http://xxxxx" >
<input type=hidden name=teks value=><center><b>KIRIM SMS GRATIS</b></center><br><br>
Nomer HP:<br />
<input class="field text small" type="text" maxlength="20" name="Phonenumbers" value="085642383165"/>
<br />
<br />
Isi Pesan:<br />
<textarea rows="5" cols="20" onKeyPress=check_length(this.form); onKeyDown=check_length(this.form); name=Text >testing pesan 2</textarea>
<br />
<input id="saveForm" class="btTxt" type="submit" value="KIRIM" name="TOMBOL" />
</body>
</html>
as you can see when the file is loaded it automatically clicks the submit button, and redirects it to http://xxxxxx
how can I run this html file from terminal? I'm using this on openwrt with webserver installed on it.
Best Answer
For those like me, who have reached this thread because they want to serve an html file from linux terminal or want to view it using a terminal command, use these steps:-
Navigate to the directory containing the html file
If you have chrome installed,
Use
Or Use
Navigate to the directory containing the html file
And Simply type the following on the Terminal:-
Then click the I.P. address 0.0.0.0:9999 OR localhost:9999 (Whatever is the result after executing the above commands). Or type on the terminal :-
Using the second method, anyone else connected to the same network can also view your file by using the URL:
0.0.0.0:9999