405 Get not allowed on apache authentification - html

I am trying to create an Auth Form for my localhost Web Server, and every time I am trying to make it works I am getting this error :
Method Not Allowed
The requested method GET is not allowed for this URL.
Well, I understand that it can't take get into consideration, but I don't really know how to resolve the problem and I don't find any example. Any help will be appreciated.
htaccess :
SetHandler form-login-handler
AuthFormLoginRequiredLocation "http://example.com/login.html"
AuthFormLoginSuccessLocation "http://example.com/admin/index.html"
AuthFormProvider file
AuthUserFile "conf/passwd"
AuthType form
AuthName /admin
Session On
SessionCookieName session path=/
And my html form :
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<form method="POST" action="/">
<input type="text" name="httpd_username" value="" />
<input type="password" name="httpd_password" value="" />
<input type="submit" name="login" value="Login" />
</form>
</body>
</html>

Related

404 not found on method POST on form

I got this simple form on a page. I run this on localhost but when I run the form it shall redirect to http://localhost:63342/welcome.html
but instead I get the 404 not found message.
When I mark the url in the browser and hit return the correct page shows. But the redirect doesnt work when using method="POST" to localhost
Any idea how to solve this?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<form method="POST" action="welcome.html">
<input type="text" id="test" name="test"/>
<input type="submit" value="test"/>
</form>
</body>
</html>
I think you want to use the GET method instead of the POST method.
Have a look here for more information: http://www.w3schools.com/TAGS/ref_httpmethods.asp

In My MVC 5 project, i can't access static html page when working on Local IIS

I have a simple ASP.NET MVC 5 project, i created a folder called static then created this html page inside it > static.html:
<!DOCTYPE html>
<html>
<head>
<title>Hello </title>
<meta charset="utf-8" />
</head>
<body>
<form action="/Customer/HelloTest" method="post">
<input type="text" value="ID"> <input type="text" name="Id" />
<input type="text" name="username" />
<input type="text" name="customers[0].id" />
<input type="text" name="customers[0].username" />
<input type="text" name="names" />
<input type="text" name="names" />
<input type="submit" />
</form>
</body>
</html>
I hosted this application on IIS.
When i run the solution and try to open the page like this:
http://localhost/FirstMVCWebApp/static/static.html
I faced only a blank page, so i don't know why this didn't open my html page, is this related to routing, should i put any route configurations or what?
I think the peoblem related to IIS as when i used IIS Express to run my web application instead of local IIS host, every things worked correctly.
You can use Url.Content() to open your static html page as below:
Open Static Page
OK, That's my answer to my question, i found that this issue didn't related to MVC, its related to IIS.
When IIS get the HTTPRequest, the first thing IIS do is to search for appropriate handler to handle it.
Handlers have lot of details, but the issue here is the handler for any static page called 'StaticFile' get the extensions of the static file that it can handle from 'MIME Types', and 'MIME Types' is a configurations located in IIS, but in my case there was no MIME Types to specify the extensions of static file so i goto and install it from Add features in control panel > IIS > StaticContent feature

How to use wget to post a html form?

I have a form like this located at http://www.sms-online.web.id:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<body>
<form method="post" enctype="multipart-form-data" name="my_form" onsubmit="clearTextBoxCounter()" action="http://www.sms-online.web.id/kirim" >
<input type=hidden name=teks value=><center><b>KIRIM SMS GRATIS</b></center><br><br>
Nomer:<br />
<input type="text" maxlength="20" name="Phonenumbers" value="08888888"/>
<br />
<br />
Isi:<br />
<textarea rows="5" cols="50" onKeyPress=check_length(this.form); onKeyDown=check_length(this.form); name=Text >
Content of my sms
</textarea>
<br />
<input id="saveForm" class="btTxt" type="submit" value="KIRIM" name="TOMBOL" />
</body>
</html>
I would like to post to that form and then submit it, how do I use wget to do the job? I've read about wget --post-data xxx but I still don't know what I should type in in the terminal, based on that html file, should I type in like this? (I'm really not sure it'll work) wget --post-data value=08585858 textarea="Content of my sms" http://www.sms-online.web.id
From this SO question:
wget --post-data="value=08585858&textarea=\"Content of sms\"" <url>
Also check this.

Auto complete in HTML doesn't really work

I'm just testing with a simple log-in page. Here are 3 text-forms.
Username, EmailAddress, Password.
When I put the value in there, hit the submit,and auto-complete works for only 2 of them. And the form (EmailAddress) is not filled at all.
I just couldn't figure out why auto-complete is not working at EmailAddress.
<!DOCTYPE html>
<html>
<head>
<title>Log in Page</title>
</head>
<body>
<form action="login.php" method='post'>
<p><strong>Login Page </strong></p>
<p>Username:<input name="username" type="text" ></p>
<p>EmailAddress:<input name="email" type="text" ></p>
<p>Password:<input name="password" type="password""></p>
<p><input type="submit" name="Submit" value="Login"></p>
</form>
</body>
</html>
Try setting the autocomplete value. It should default to on, but I'd try adding it.
It's also possible your browser has already recorded the data for the autocomplete (as it seems by the image at least), which could mean the browser no longer tries to find anything. Try renaming all the fields and the form (just to test it out, of course) and see if your browser inquires you to save the form data upon submission.
<!DOCTYPE html>
<html>
<head>
<title>Log in Page</title>
</head>
<body>
<form action="login.php" method='post'>
<p><strong>Login Page </strong></p>
<p>Username:<input name="username" type="text" ></p>
<p>EmailAddress:<input name="email" type="text" autocomplete="on"></p>
<p>Password:<input name="password" type="password""></p>
<p><input type="submit" name="Submit" value="Login"></p>
</form>
</body>
</html>

Building a login page

Does anyone have a good start for a simple front end html login? I am pretty new with html and coding in general. Also how do I connect the login with my other work such as the database?
<html>
<head>
<title>
Login page
</title>
</head>
<body>
<form name="login">
Username<input type="text" name="userid"/>
Password<input type="password" name="pswrd"/>
<input type="button" onclick="check(this.form)" value="Login"/>
<input type="reset" value="Cancel"/>
</form>
</body>
</html>
that is just a pretty simple login form with no css to it, but I would just go to bootstrap and use their login form at http://getbootstrap.com/examples/signin/