Safari 3.2.1 sends POST followed by GET requests - forms

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.

Related

How to send data in form secretly

I want send hidden data with form.
my code is:
` <form action="my address" method="post">
<div>
<label for="title">Post title:</label>
<input type="text" id="title" name="title" value="My excellent blog post" />
</div>
<div>
<label for="content">Post content:</label>
<textarea id="content" name="content" cols="60" rows="5">
This is the content of my excellent blog post. I hope you enjoy it!
</textarea>
</div>
<div>
<button type="submit">Update post</button>
</div>
<input type="hidden" name="seckey" value="34657" />
</form> `
I use hidden input, but is not safe.
I want to send "seckey" secretly in a way ,that is not available in any way and anybody not access it. Completely safe
but if I use hidden input, the "seckey" is visible in the source page or inspect element in browser.
How to post the "seckey" in the form without it even being clear in the page source

Unable to receive form submissions on Netlify deploys

I am using a simple form that was taken from one of the Netlify related docs:
<form name="contact" action="/" method="post" data-netlify="true">
<div className="field">
<label htmlFor="name">Name</label>
<input type="text" name="name" id="name" value="dave"/>
</div>
<div className="field">
<label htmlFor="email">Email</label>
<input type="text" name="email" id="email" value="email#email.com" />
</div>
<div className="field">
<label htmlFor="message">Message</label>
<textarea name="message" id="message" rows="6"></textarea>
</div>
<input type="submit" value="Send Message" className="" />
</form>
In using gatsby develop and working with/submitting the form, things seem to work fine. I get no errors and get redirected to the home page as expected.
After deploying the site with Netlify and trying to submit the form, I get the following page error:
In my Netlify backend, the form appears in the console but I cannot/do not receive submissions.
I am using a barebones gatsby-config.js, only incorporating gatsby-source-wordpress and gatsby-plugin-google-analytics.
I also tried adding /no-cache=1 to form action.
Can anybody advise?
It might also be worth noting that I have coded my form as a component and am importing it into my footer as such. In that way, it may be imported multiple times on different pages as mentioned in point 3 of this StackOverflow answer.
Thanks.
I learned that because I'm using Gatsbyjs, and Gatsby + Netlify = javascript forms, I needed to add another input type="hidden" to my form:
<form name="my-form" ... >
<input type="hidden" name="form-name" value="my-form" />
The documentation for this wasn't immediately clear but below are some links that address this:
Here's a link to an article that pointed me to the answer: How to
Integrate Netlify’s Form Handling in a React App
Here's another one if you're building in Vue: How to Integrate
Netlify Forms in a Vue App
And all about Netlify Forms
If you are using any redirect method then you have to add _redirects file in your root folder and add paths to it so that redirect can work.
It's may be confusing but you can visit this link for more help.

ExpressionEngine channel form file upload

I'm trying to allow my users to upload a videos. My channel has "file" as the first channel field.
Made a channel form with the following code. When I try to upload anything I get the error field_id_5 is a required field (this is my file field). The only way i get the form to go through is if I make the video file not require, in which case all the other info goes through.
WHen i create a post in this channel through the EE control panel, it works. Video file is uploaded and all and it shows up in my channel in the video player.
Any help? Very new to coding so it may be a very simple mistake somewhere.. apologies :)
I managed to get it working with {field:video_file} instead of input tags but then I can't control what types of files they can send...
{exp:channel:form channel="video_post_uploaded"}
<p class="form_text">Post Title:
<br><input type="text" name="title" id="title" value="{title}" onkeyup="liveUrlTitle();" class="form_input">
<!-- <p>URL Title: -->
<br><input type="hidden" id="url_title" name="url_title" value="{url_title}" class="form_input">
<!-- <p class="instructions">Don't worry about this one, it fills itself out automatically. -->
<p>Upload Video:
<p><input type="file" name="video_file">
<p class="instructions">{instructions:video_file}
<p>Game:
<br><select name="game_title_uploaded">
{options:game_title_uploaded}
<option value="{option_value}"{selected}>{option_name}</option>
{/options:game_title_uploaded}
</select>
<p class="instructions">{instructions:game_title_uploaded}
{status_menu}
<select name="status" class="hidden">
{select_options}
</select>
{/status_menu}
<p><input type="submit" value="Post It!" class="submit_button">
{/exp:channel:form}
You cannot use it with just input type file. EE needs another hidden field to indicate directory of file to upload.
You can use it like this:
<input type="file" name="video_file">
<input type="hidden" name="video_file_directory" value="1">

Classic ASP form not working in Opera, Chrome, or Firefox (but does in IE)

I'm working with a Classic ASP site and having a bit of a conundrum... my form works perfectly in IE, but in Chrome, Opera, and Firefox I can't click anything within the form - I can't type or even get a cursor to show up in the input fields, the link isn't clickable and neither is the button. The mouse pointer doesn't even change on mouseover of any of those elements.
The doctype is HTML 4.01 Strict, and I have validated it with the W3 validator. The links in the page's header and footer are clickable as normal.
<form name="esi" method="post" action="employeehome.asp">
<p>
<label for="empid" class="achtung">Employee ID:</label><br>
<input type="text" name="empid" size="20" maxlength="30">
</p>
<p>
<label for="emppw" class="achtung">Password:</label><br>
<input type="password" name="emppw" size="20" maxlength="20"><br>
Password Recovery
</p>
<p>
<input type="hidden" name="empstatus" value="1">
</p>
<p class="submitbuttonspace">
<input type="submit" value="Sign In">
</p>
</form>
There is nothing wrong with this form example. I just tested it on my server. No errors and nothing to disable anything.
You must have something else crashing your browser.

Internet Explorer form submit with target to iframe not working

I'm using the hidden iframe method of submitting files without loading a new page, and it works on every browser except Internet Explorer, which is strange coming from an otherwise top-notch browser.
The form and iframe look like this:
<iframe id="hidden_upload" style="display:none" src="" name="hidden_upload" ></iframe>
<form class="" action="upload.php" method="post" target="hidden_upload" enctype="multipart/form-data" id="uploadForm">
<table>
<tbody>
<tr>
<td><label for = "title">Title: </label></td>
<td><input type="text" name="title" id="title" maxlength="40" style="width:300px;"/></td>
</tr>
<tr>
<td><label for="description">Description: </label></td>
<td><textarea id="description" name="description" style="width:460px;height:135px;"></textarea></td>
</tr>
<tr>
<td><label for="file">File: </label></td>
<td><input type="hidden" name="MAX_FILE_SIZE" value="3145728" /><input id="file" type="file" name="file"/></td>
</tr>
</tbody>
</table>
<center><input type="submit" value="Upload" id="filesubmit" onclick="return submitting()"/></center>
</form>
I have another page that DOES work in IE, with no discernible differences in the doc type, or form and iframe structure.
It's also not the headers from the upload page because I tried setting the action of the working form to the upload page of the non-working one and it still worked in IE.
The function submitting is working an returns true.
edit:
For the sake of brevity, this isn't working either:
<form class="" action="upload.php" method="post" target="hidden_upload" enctype="multipart/form-data" id="importForm">
<input type="submit" />
</form>
<iframe id="hidden_upload" style="display:none" src="" name="hidden_upload" ></iframe>
edit: This is completely ridiculous. I copied the working page verbatim into the non-working page and it still didn't work. The ONLY difference was the directory, and the .htaccess files were identical.
I had this problem and after many attempts, it was solved only as explained here:
"http://terminalapp.net/submitting-a-form-with-target-set-to-a-script-generated-iframe-on-ie/"
basically, iframe needs to be created this way:
iframe = document.createElement('<iframe name="fileUploaderEmptyHole">');
I also found out frame names for current window are stored in window.frames. In IE11, the property .name is empty for all iframes in windows.frames :O
I manually fixed like:
for(i=0;i<window.frames.length;i++)
window.frames[i].name = window.frames[i].frameElement.name;
Then, you can get to frames using target name.