Hash value in jsp file client side - html

In my dynamic web project I am using this form to submit username and password to my jsp file loginRequestHandler.jsp to check later in a Java Class if the data exists.
<form action="loginRequestHandler.jsp">
<table cellpadding="5">
<tr>
<td><b>Benutzername:</b></td>
<td><input type="text" name="email" required /></td>
</tr>
<tr>
<td><b>Passwort:</b></td>
<td><input type="password" name="password" autocomplete="new-password" required/></td>
</tr>
<tr>
<td colspan="2" align="right"><input type="submit" value="Anmelden" /></td>
</tr>
</table>
</form>
How can I hash the password client side that the password will be NOT send in a clear view to my server? I will later add SSL, too.
How do I need to save the password in my database that the check will work?

Related

Set HTML label to WebService invocation's result

Rather new to webservices when it comes to implementing them in HTML. I've been doing research on this for, no joke, an entire month, and still found nothing. Here's the code - The idea is it's just a simple email sender from a fixed email address, and the webservice is called directly from the form.
<body>
<form id="mainForm" method="post" action="http://habakkuk/api/emailHandler.asmx/SendEmailMain"">
<table>
<tr>
<td class="textcolumn">
To:
</td>
<td>
<input type="text" size="50" name="m_To"/>
</td>
</tr>
<tr>
<td class="textcolumn">
Subject:
</td>
<td>
<input type="text" size="50" name="m_Subject"/>
</td>
</tr>
<tr>
<td class="messageText">
Message:
</td>
<td class="messageBox">
<textarea name="m_Body" cols="50" rows="10"></textarea>
</td>
</tr>
<tr>
<td class="textcolumn"></td>
<td>
<input type=submit value="Send Message">
</td>
</tr>
</table>
</form>
<p>
</p>
</body>
Thing is, even this bit took me a week's worth of searching, to add to the ridiculousness. Now my issue is getting the webservice result to set the text of a label or something somehow. Preferably, I'd want an alert, though as far as I am aware, that's a javascript bit and I'm not sure how to go about that either.
Any pointers, assistance, or references to an already answered question I may have missed will be of major help.

Image upload in HTML not working

Here the code which i have used to upload the image to server.But it returns "The requested URL / was not found on this server." error.
<form name="uploadFile" action="http://http.brammies.com" method="post" enctype="multipart/form-data" onSubmit="return validate();">
<input type="hidden" name="choice" value="upload">
<table align="center">
<tr>
<td><span style="color:red;font-weight:bold">Upload files</span></td><td><input type="file" id="ufile" name="ufile" onKeyPress="return false;" style="BACKGROUND-color:Thistle">(* jpg,gif,png)</td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" name="submit" value="Upload" style="BACKGROUND-color:Thistle"></td>
</tr>
</table>
</form>
Can any one tell me whats wrong with my code?
The URL http://http.brammies.com does not refer to a form handler. From the outside, it is impossible to tell what the action attribute value should be.
From the response given by the server when http://http.brammies.com is accessed directly, it seems that the attribute value should be http://http.brammies.com/cgi-bin/ followed by some filename of a CGI script.

IE10 automatically submits HTML form

Hi I have a fairly simple HTML login form:
<form name="login" action="checklogin.php" method="post">
<table>
<tr>
<td>Login to Continue</td>
</tr>
<tr>
<td>Username</td>
<td><input name="username" type="text" value=""></td>
</tr>
<tr>
<td>Password</td>
<td><input name="password" type="password" value=""></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><input type="submit" name="Submit" value="Login"></td>
</tr>
</table>
</td>
</form>
This works fine in Google Chrome but when it comes to IE10 on Windows 7 the form auto completes and submits. I have checked the obvious auto complete options in IE10 and ensured they are off and all stored information is cleared. However the form still gets auto completed and submitted. Is there some way of explicitly instructing IE10 not to do this?
Ok got it. This is an HP machine and it was running HP Simple Pass. This installs a BHO Add-in to IE 9+ called "True Suite Website Logon" which was responsible for this behaviour. Thanks for the help.

Html5 form validation in CodeIgniter

I am using codeigniter. I have written simple from code with html5 validation.but its not working.its still go to the controller..This is my code.
<?php echo form_open('welcome/RigesterValue');?>
<h4> Rigesteration </h4>
<table border="2" align="center">
<tr><td><label>First name</td>
<td><input type="text" maxlength="20" id="First_name" name="First_name" required pattern="[A-Z ]+"></td></tr>
<tr><td><label>Last name</td>
<td><input type="text" maxlength="20" name="Last_name"></td></tr>
<tr><td><label>User name</td>
<td><input type="text" maxlength="20" name="User_name"></td></tr>
<tr><td><label>Password</td>
<td><input type="password" maxlength="20" name="Password"></td></tr>
<tr><td><label>Confirm Password</td>
<td><input type="password" maxlength="20" name="Confirm_Password"></td></tr>
<tr><td><label>Address</td>
<td><input type="text" maxlength="20" name="Address"></td></tr>
<tr><td><label>Cell number</td>
<td><input type="text" maxlength="20" name="Cell_number"></td></tr>
<tr><td><label>Email</td>
<td><input type="text" maxlength="20" name="Email"></td></tr>
<tr><td><Label>Status</Label></td>
</td></tr><br>
<tr><td align="center" colspan="2"><input type="Submit" value="Register"></td></tr>
</table>
<?php echo form_close();?
I have apply html5 validation on just first field ..Which is First_name..but still it go to the controller page.
CodeIgniter's own validation often does the trick. It's most safe since it will receive values, validate them and then process them.
Validation through the browser isn't reliable due to things like Firebug and so on. In the end I can easily post whatever values I want to your page, and if validation only covers HTML5 etc, your system won't know what hit it.
Always let your server validate everything, but you may aswell let some thing be done also inside your view. For instance, finding an unoccupied username can be a hazzle if you need to post every time just to hear that it's taken, therefor the part can be done through ajax that checks if username is taken or not and shows before submit.
If you get form_validation to work as intended, you probably won't see much need for more ways to validate your fields.

How to store several HTML form fields in one mysql table field?

I want to store several fields from a html form in one table field. Here is the source code for the form. This is only part of the form, the form tags are there. Attached is a screenshot from this part of the form.
<table border=0 cellpadding=0 cellspacing=0>
<tr>
<td><input class="field checkbox" type="checkbox" value="Automotive" /><label class="choice">Automotive</label></td>
<td> Remark:<input name="rem_app_1" type="text" size="50" value=""/></td>
</tr>
<tr>
<td><input class="field checkbox" type="checkbox" value="Backlights"/><label class="choice">Backlights</label></td>
<td> Remark:<input name="rem_app_2" type="text" size="50" value=""/></td>
</tr>
<tr>
<td><input class="field checkbox" type="checkbox" value="Signage/Traffic lights"/><label class="choice">Signage/Traffic lights</label></td>
<td> Remark:<input name="rem_app_3" type="text" size="50" value=""/></td>
</tr>
<tr>
<td><input class="field checkbox" type="checkbox" value="IR" /><label class="choice">IR</label></td>
<td> Remark:<input name="rem_app_4" type="text" size="50" value=""/></td>
</tr>
<tr>
<td><input class="field checkbox" type="checkbox" value="LED lights"/><label class="choice">LED lights</label></td>
<td> Remark:<input name="rem_app_5" type="text" size="50" value=""/></td>
</tr>
<tr>
<td><input class="field checkbox" type="checkbox" value="Mobile devices"/><label class="choice">Mobile devices</label></td>
<td> Remark:<input name="rem_app_6" type="text" size="50" value=""/></td>
</tr>
</table>
The way it is stored in mysql should be like this, depending on what checkbox the user clicks,e.g.:
Automotive, Remark: blablabla
Backlights, Remark: blubblubblub
Mobile applications, Remark: skdfjasldfkj
Start with adding a name field to those checkboxes. What language are you using for form processing? PHP?
What backend language are you using on your server? Mysql is not a server language itself, but a means to communicate with a database. You need a server language to handle server requests. Check out PHP, ASP.NET, and Django. Arguably, PHP is the easiest to pick up, install, and set up.
Once you have a backend language, you can use that language's Mysql bindings to communicate with your database.