Submit basic HTML form using Postman - forms

I am trying to log into this website using Postman.
There is no username and this is what the HTML look like:
<body>
<div class="container">
<div class="loginbox">
<img id="logo" src="../gfx/logo.png" alt="" />
<form action="" method="POST">
Password: <input type="password" name="password" id="password" />
<button type="submit" name="submit" id="submit">Submit</button>
</form>
<p id="message">
</p>
</div>
</div>
</body>
This my POST request on Postman and I am not getting any "Wrong password." html back so I guess I am not doing the correct thing. How can I make a POST request to login using Postman?

The form includes two values, password and submit. The latter has no value associated with it, but the key is still being posted to the server.
It seems that the server-side code is using the submit key to trigger its logic. Just include that in your form data with no value.

Giving a "submit" key as empty in addition to the password field is needed . Please refer the sample request image given.

Related

how to use a Hubspot form embed code with a bootstrap form

I have a client that uses hubspot for their tracking and thank you pages. I have created a landing page using bootstrap and within the page I have two forms. Both forms are the same and I want them to go to the same thank you page. The client has provided me with an embedd code but I am not sure how I can bridge the gap. Below I have listed my form code and the embed code. I basically want the user fields to be submitted into hubspot and for it to trigger the thank you page but I am not entirely sure this is possible. Any help would be appreciated.
<div class="col-lg-12 contact-form">
<div class="container">
<div class="formContainer">
<form role="form">
<div class="form-group">
<div class="col-sm-6 left-field">
<input type="text" class="bottom-form" id="firstname" placeholder="First Name">
</div>
<div class="col-sm-6 right-field">
<input type="text" class="bottom-form right-field" id="lastname" placeholder="Last Name">
</div>
</div>
<div class="form-group">
<div class="col-sm-12">
<input type="email" class="bottom-form email" id="email" placeholder="email">
</div>
<div class="col-sm-12">
<button type="submit" class="submit bottom-submit">Download Now</button>
</div>
</div>
</form>
</div>
</div>
</div>
Here is the hubspot embedd code.
<!--[if lte IE 8]>
hbspt.forms.create({
css: '',
portalId: '2030148',
formId: 'd9005302-a859-4a39-9d47-74d8a1d25fb0'
});
Are you just looking to set the redirect with the embed code? If so, here is the addition to the embed code:
portalId: 'xxxxxx',
redirectUrl: 'url goes here',
formId: 'd9005302-a859-4a39-9d47-74d8a1d25fb0'
I actually figured out a proper solution without having to do any redirects or hairy coding.
First I setup a local host, which was my biggest issue, this helps with getting the actual hubspot form to show within my page (using a local show the embedd code does not appear, although obvious to others, it took me a sec). Oh, I should mention that the code is not necessary.
Once you have it showing you basically inspect the element and then add to the classes that hubspot spits out get it to look that way you want too.

How do I get this Newletter Form to work?

I'm not sure what to put in for href:\ Should I reference a mailhandler.php or use a mailto: command? Or is there something better?
<h3 class="margin-bot">Newsletter!</h3>
<form id="subscribe-form" name="sibscribe" method="post">
<label><input class="subscribetext" type="text" onFocus="if(this.value =='Enter E-mail:' ) this.value=''" onBlur="if(this.value=='') this.value='Enter E-mail:'" value="Enter E-mail:" name="keyword" /></label>
<a onClick="document.getElementById('subscribe-form').submit()" class="button" href="#">subscribe</a>
</form>
I think it is meant for the site to which you get after pressing the subscribe button. Preferably the page the form was implemented in (for example to return to the index.html).
You can try it by testing it here on jsfiddle (http://jsfiddle.net). Just put an URL in the field where now is the # and after pressing subscribe you will see that you'll be redirected to that page.

Zend Controller fails to retrieve POST values from Zend Form in Chrome and Safari

EDIT: Resolved itself. Recreated the LoginController and issue is gone. Thanks for the responses!
So I'm fairly new to Zend, so maybe I'm missing something blaringly simple. The scenario is pretty straightforward. I have a Zend_Form on index submit to /login, where I want to handle the username and password vars. I use a custom decorator to setup the form, and the resulting HTML looks like so:
<form id="loginForm" name="loginForm" enctype="application/x-www-form-urlencoded" method="post" action="/login">
<div class="input-container" id="username-container">
<input type="text" name="username" id="username" value="" helper="formText">
<div class="input-overlay">Username/Email</div>
</div>
<div class="input-container" id="password-container">
<input type="password" name="password" id="password" value="" helper="formPassword">
<div class="input-overlay">Password</div>
</div>
<div id="dropdown-checkbox-forgot-container">
<div class="checkbox-container" id="checkbox-container-rememberMe">
<input type="hidden" name="rememberMe" value="0">
<input type="checkbox" name="rememberMe" id="rememberMe" value="1" checked="checked" helper="formCheckbox" text="Remember me" class="light">
<div class="light checkbox-text" id="checkbox-text-rememberMe">Remember me</div>
</div>
Forgot password?
</div>
<input type="image" name="login" id="dropdown-login-submit" src="">
</form>
Great! Let's submit it! I put a simple var_dump in my LoginController to confirm that the values are transferred properly. var_dump($this->getRequest()->getPost()). FF and IE both show the values as they are supposed to be. However, Chrome and Safari do not show the username or password inputs. There is only a rememberMe value in the POST array. Strange...
Now I figure it might be Zend's accessing of the POST superglobal, so I change my code to var_dump($_POST). Same problem. In frustration I tried var_dumping both the $_POST and $this->getRequest()->getPost()....and it worked!? It dumped one copy with only the rememberMe input and one copy with everything (username and password included). No idea why or how that worked. Any insight as to what the problem might be would be greatly appreciated!
Recreated my LoginController through ZendTool and all worked as expected.

How to capture current dynamic output of JSP and email it?

In my webapplication, a JSP page outputs to the webpage, the list of users logged in that day. I want to mail the same output to specifics mail-ids. What all Struts2 tags do I need to use?
Grab the HTML using JavaScript and send it as request parameter.
<div id="content">
... (here you should put content which you'd like to mail)
</div>
<form action="mail" method="post" onsubmit="html.value = encodeURIComponent(document.getElementById('content').innerHTML)">
<input type="hidden" name="html" />
<input type="submit" value="Mail this document" />
</form>
It'll be available as request parameter with name "html" in Struts2/Servlet side. The emailing job can be done with help of JavaMail.

Safari 3.2.1 sends POST followed by GET requests

I've a servlet running on Tomcat 5.5.27 and 5.5.26 and have a web form with POST method.
If I use Safari 3.2.1 I see from the logs that Tomcat receives a POST followed immediately/contemporarily by GET and it fails.
If I use Firefox 3.0.5 I see that it sends only POST and everything works.
Trying to debug with Eclipse I see that when using Safari it is the doGet() method that is called while when using Firefox is doPost().
Practically it seems that Safari fires both POST and then immediately GET, while Firefox fires only POST (as it should according to the HTML form).
Is there somebody else who as experienced this ? In this case is there a solution ?
Here is a snippet of the HTML form:
<form action="/vidisearch/Search" method="post" name="SearchForm" id="SearchForm">
<div class="input required">
<label for="Concepts">Concepts, comma separated<br />
ex. (remove quotes) "man-made object, cemetery, graphic event, atmospheric event, tool event"</label>
<input name="concepts" type="text" value="" id="concepts" />
</div>
<div class="input required">
<label for="Operators">Operators, comma separated<br />
ex. (remove quotes) "NOT, AND, OR, AND, AND"</label>
<input type="text" name="operators" value="" id="operators" />
</div>
<div class="input required">
<label for="Specializations">Specializations, comma separated<br />
ex. (remove quotes) "true, false, false, true, false"</label>
<input type="text" name="specializations" value="" id="specializations" />
</div>
<div class="input required">
<label for="Results">Various parameters</label>
<table width="100%" border="0" style="border: 0;">
<tr>
<td>Ontology ID<br />
<input name="ontologyID" type="text" id="ontologyID" value="" /></td>
<td>Result page<br />
<input name="page" type="text" id="page" value="0" /></td>
<td>Shots per page<br />
<input name="shotsPerPage" type="text" id="shotsPerPage" value="20" /></td>
<td>New search<br />
<input name="newSearch" type="text" id="newSearch" value="true" /></td></tr>
</table>
</div>
<div class="submit"><input type="submit" value="Search" /></div>
</form>
I think you have an image tag that has an empty src.
It's hard to say without seeing your HTML for the form, but perhaps your submit button is a wrapped with a link, and Safari is both POSTing the form and following the link (via GET).
I'm not sure what's happening but what I do know is that you need to provide more information.
Maybe it's sending a GET for associated resources (like images) whereas Firefox keeps them in the cache, or you have the form submit button inside an <a> tag, for instance.
Another alternative is a Javascript incompatibility, in case you are submitting something via Javascript.
Sniff the traffic (check out Fiddler or Wireshark) and see what is Safari trying to GET and what's it is POSTing
I'm quite puzzled by the behaviour of Safari since I remind that sometime ago it worked. I'm fearing that one of the latest upgrades has broken something.
Using HTTPScoop I've seen that apparently Safari fires POST followed by GET when it gets the response. I think however that it actually fires both requests at the same time since the date+time of the two responses is the same for both POST and GET.
The response is a RSS feed and has the HTTP/1.1 200 OK code. The second GET asks for the same request URL (http://127.0.0.1:8180/vidisearch/Search) of the POST but the body is 0 bytes, it has of course no GET parameters and the answer is wrong because of the missing parameters.
Firefox instead fires only the POST and gets the correct answer.