0

when i give an input field value as blackhat%%1985 and submit i get the post value as blackhat%85 the value is changed after require_once BASEPATH.'core/CodeIgniter.php';

<form action="" method="post" id="submitForm">
<input type="hidden" name="a" value="blackhat%%1985" />
<input type="submit" name="b" />
</form>
3
  • Why don't you encode the value (blackhat%25%251985)? Commented Feb 19, 2013 at 9:32
  • @Shomz here user submit their password.. how to encode before submittion? Commented Feb 19, 2013 at 9:35
  • You can use JavaScript's encodeURIComponent to change the value before submitting the form. encodeURIComponent('blackhat%%1985'); Commented Feb 19, 2013 at 9:45

2 Answers 2

1

use urlencode() function for this.

Sign up to request clarification or add additional context in comments.

Comments

0

You can use JavaScript's encodeURIComponent to encode the value before submitting the form.

encodeURIComponent('blackhat%%1985');

Of course, don't forget to decode it on the server-side after that.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.