I'm kinda new here and I've got a programming/coding related question you guys maybe could help me with. I'm currently playing this game on the net www.darker-future.nl which is sort of a site you got to hack/use IT knowledge to go up levels. I'm kinda stuck at this level which i obviously lack the knowledge of coding for?
Ive got this HTML source code in the page:
<form method='POST' action='**************.html'>
<input type=hidden name='40+b+c*d' value='2354'>
<input type=hidden name='a*30-c+d' value='8937'>
<input type=hidden name='a-b-20/d' value='3639'>
<input type=hidden name='a%b+c-10' value='3954'>
<input type=hidden name='a+b*c*d' value='9284'>
<input type=hidden name='a-b/c-d' value='6573'><!-- +0.5 -->
<input type=text name='a*b/c/d'><br>
<input type=submit>
</form>
I think i got to change the values from the hidden input boxes with the right answers or something. My question: How can I easily fake POST values?
PS. Any tips on maybe things i've forgot to think about in this level please share.
If you're using Firefox, get Firebug, open the HTML panel, and edit the value attribute. Simple.
Are you sure it wants you to change the POST values "in flight" as it were.
Surely you need to find the values of a, b, c and d based on the 6 equations it gives you (simultaneous equations), and put the resulting values into the seventh expression to generate a value.
Then enter this value into the text box and click submit.
Yes get the firebug extension for Firefox. After it's installed click the little bug icon in the bottom left corner. You can edit the HTML in the firebug window to change the values.
A more long winded solution would be to write some code to generate an HTTP Post request in the correct format.
Related
For a few months now we've been seeing the following dropdown for most of our HTML input boxes. Our input boxes have generic names e.g. Field1, Field2 and Field1 on one form is not the same as Field1 on another form, so the options provided are usually senseless.
Example dropdown
Anybody know how to turn this functionality off?
I don't know what to call it. I've tried searching for autocomplete and autofill but not sure if either of those terms are what is happening.
well in the past autocomplete="chrome-off" always did the job, but for other browsers sometimes it does not work, so first try these two solutions and if they don't work try autocomplete="chrome-off".
<form autocomplete="off">
<input type="text" id="YourId" autocomplete="none"/>
</form>
or
<form autocomplete="false">
<input type="text" id="YourId" autocomplete="none"/>
</form>
I hope it helps.
It is autocomplete and I managed to turn it off with:
autocomplete="off"
think I'd been trying "none" before.
Autocomplete has been causing me trouble for quite some time. It overlays buttons and search results which causes users to click it instead of a link on the webpage.
I have been searching the internet for solutions to this for literally years. None of them are both practical and work consistently. I have tried all the alternatives to "off" listed throughout the relevant Google searches.
Below I have uploaded a GIF. The GIF shows me triggering autocomplete on an input which has autocomplete set to off.
I then remove the name attribute of a separate input within the form and suddenly autocomplete switches off.
I also demonstrate that having the keyword "Company" in the placeholder seems to override autocomplete=off. However, this does not seem to override autocomplete=off in all situations.
In the below example I used a datepicker, but I can also reproduced the problem with simple text inputs.
Is there a reason behind this strange behavior?
One solution is to use type="search", however, this may not be the desired approach for all developers.
Thanks in advance.
Have you tried this ?
<input name="unm" id="unm" type="text" autocomplete="false" readonly onfocus="this.removeAttribute('readonly');" />
Try using a form method.
<form method="post" action="">
<div>
<label for="cc">Please work:</label>
<input type="text" id="cc" name="cc" placeholder="Enter a company here" autocomplete="off">
</div>
We have some really old code from which one part like 15k lines of code make a really old fashioned procedural form content menagment system.
Now here comes the stupid part. Whole code is based so it nests form elements. Wich is by definion wrong. we have code like
<form action="demo_post_enctype.asp" method="post" enctype="multipart/form-data">
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br>
<input type="submit" value="Submit">
.
.
.
.
<form enctype="multipart/form-data">
<input type='File'>
</form>
</form>
Now this is only the teoretical layout. the whole thing is so complex and "uniquely" unprofesionally made that my head hurts.
The strange thing is it works, kinda, no idea how. And now we have a problem to upload files bigger then around 28mb. I checked the server settings it is set to 1gb upload size and it works without problems in the new refactored parts it works.
Question:
What is the effective upload size of such buggy code?
We need to give curent users the feedback while the old code gets refactored.
Although the code doesn't work as intended, it can still work in a sense. As nested forms are invalid, as far as I know all browsers will handle the problem by ignoring the starting tag for the inner form, and end the form at the ending tag of the inner form.
So, as long as the inner form is at the end of the outer form, it will be a single form containing all the fields, and will be posted to the action of the outer form.
While there will be some extra fields included when you upload a file, that would hardly account for so much data that the upload size would be noticably reduced. Perhaps it's the fact that the data is posted to a different page than intended that causes the problem.
Short version:
How can I have my form's button label text differ from the value submitted to the server without using the <button> tag?
Long version:
I wanted to have the text that appeared in a button in a form to be different than the value submitted in the query string. So, I looked around, and came across this approach...
<button name="method" type="submit" value="repackage">Update Config</button>
...and that worked on IE9 on one of my laptops and I was happy. The user saw "Update Config" and the server received method=repackage in the query string.
Then I brought this app to work and ran it on a workstation, also with IE9. But something had gone wrong. The user still saw "Update Config", but the server now received method=Update%20Config in the query string.
So I investigated some more. I found that www.w3schools.com recommmended not using a <button> tag in a form. They say: "If you use the <button> element in an HTML form, different browsers may submit different values. Use <input> to create buttons in an HTML form" in this article. This seems to be what I am experiencing.
So I looked some more, and found lots of conflicting information about the right way to do this. For example here is a Stack Overflow post that asks exactly this question, but the accepted answer is to use the <button> tag. I can say from experience and research that this is not a reliable approach.
For newcomers: With some CSS this works like a charm as of September 2017:
<form>
<label style="padding:5px; cursor:pointer; border:solid 1px; border-color:#ccc">
<input style="display:none" type="submit" name="method" value="repackage">
<span>Update Config</span>
</label>
</form>
If there's no other way try this:
Use an image button, instead of button. An image button will work as ordinary submit button, but you create an image of the desired button text (no one can change your text then).
<input type="image" src="http://images.webestools.com/buttons.php?frm=2&btn_type=31&txt=Update+Config" name="method" value="repackage">
This works as well. Manipulate the appearance using the bootstrap button classes.
<label class="btn btn-primary">
<input class="d-none" type="submit" name="method" value="repackage">
Update Config
</label>
I'm working on a Rails site, and I've got my database indexed with IndexTank. I have things set up so that to search, all I have to do is browse to [root]/search?q=[query]. To simplify things, I'm planning on just dropping a HTML form with a textbox and a submit button in amongst the erb, but I'm not quite sure how to pass the information from the text box to the end of the /search?q= line.
I'm sure that this is terribly basic, but I've been Googling all morning and I've come up empty-handed.
<form action="/search">
<label>Search term <input name="q"></label>
<input type="submit">
</form>
First off, you'll probably need to post some more code. That said, the solution is likely as simple as setting your form element's method attribute to GET.