404 not found on method POST on form - html

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

Related

Regex in HTML Input pattern isn't working, but the expression is valid

I have a URL input field on a form, and this must accept only Youtube and Vimeo URLs. I got a regex like this:
(?:(?i)(?:https:|http:)?\/\/)?(?:(?i)(?:www\.youtube\.com\/(?:embed\/|watch\?v=)|youtu\.be\/|youtube\.googleapis\.com\/v\/)(?<YoutubeID>[a-z0-9-_]{11,12})|(?:vimeo\.com\/|player\.vimeo\.com\/video\/)(?<VimeoID>[0-9]+))
And it works. Tested here: https://regex101.com/r/PVdjg0/2
But when i have inserted this pattern on my field, it doesn't work. My field are aceppting any URL.
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<form>
<input type='url' required pattern='(?:(?i)(?:https:|http:)?\/\/)?(?:(?i)(?:www\.youtube\.com\/(?:embed\/|watch\?v=)|youtu\.be\/|youtube\.googleapis\.com\/v\/)(?<YoutubeID>[a-z0-9-_]{11,12})|(?:vimeo\.com\/|player\.vimeo\.com\/video\/)(?<VimeoID>[0-9]+))' title='URL Vimeo/Youtube.' name='video' placeholder='Video URL' />
<input type='submit'>
</form>
</body>
</html>
And i don't know why! I miss something? Somebody can help me?

How to create html form that directly goes to specific search on a website?

I know that the code below will go to the result page of google when the user types some texts and the submit button is clicked.
<!DOCTYPE html>
<html lang="en">
<head>
<title>
Hello!
</title>
</head>
<body>
<form action="https://www.google.com/search" method="get">
<input name="q" type="text">
<input type="submit" value="Submit Form">
</form>
</body>
</html>
But I try this with https://www.jitta.com/. It does not seem to have the same structure as google.
When searching on this website the url will be https://www.jitta.com/stock/bkk:ptt where "ptt" is the word that I want to search. Unlike google, if I want to search "ptt" the url will be https://www.google.com/search?q=ptt.
Can it be only HTML code? no other parts involved (like Javascript,...)
Appreciate anyone who answers this.

405 Get not allowed on apache authentification

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>

Bootstrap. What's controlling where the form is sent?

I am using Bootstrap with forms. How the "method=" or "action="?
What is telling it what to do/where to go? Should there be a "method"?
What's controlling where the form is sent?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>my form</title>
<meta name="description" content="title page.">
<link href="twitter-bootstrap-v2/docs/assets/css/bootstrap.css" rel="stylesheet">
</head>
<body>
<form class="well">
<label>test page</label>
<input type="text" class="span3" placeholder="Type something…">
<label class="checkbox">
input type="checkbox"> Remember me
</label>
<button type="submit" class="btn">Submit</button>
</form>
</body>
</html>
Your question has nothing to do with bootstrap. Those are form tag attributes.
Refer : Form_Tag
action Specifies where to send the form-data when a form is submitted
method Specifies the HTTP method to use when sending form-data. Default method is GET.
Example : <form action="next_page.html" method="get">
Notes on GET:
Appends form-data into the URL in name/value pairs
The length of a URL is limited (about 3000 characters)
Never use GET to send sensitive data! (will be visible in the URL)
Useful for form submissions where a user want to bookmark the result
GET is better for non-secure data, like query strings in Google
Notes on POST:
Appends form-data inside the body of the HTTP request (data is not shown is in URL)
Has no size limitations
Form submissions with POST cannot be bookmarked

Can't get TinyMCE 4.0.6 to work

This is driving me crazy....
I'm trying to get TinyMCE v4.0.6 to work, and I'm probably doing something very dumb, since I can't get the editor to display at all.
I could get a v3.5.8 editor to show in a page similar to what follows, but no joy with this:
<!DOCTYPE html>
<html>
<head>
<title>TinyMCE Test</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<script type="text/javascript" src="tinymce/tinymce.min.js"></script>
<script type="text/javascript">
tinymce.init({
selector: "textarea"
});
</script>
</head>
<body>
<form method="post" action="something">
<textarea name="content" cols="100" rows="15">content</textarea>
<input type="submit" value="Save" />
</form>
</body>
</html>
I've verified (using FireBug) that the path to the tinymce JavaScript file is correct, but other than that, I'm completely at a loss.
Thanks for any suggestions..
After your comment, I took your HTML and checked it with a CDN copy of tinyMCE and it work fine: http://codepen.io/anon/pen/mIvFg so I can only assume it's an error with your tinymce.min.js file.