Why can’t I send the "+" character via post in a simple HTML form?

Asked

Viewed 112 times

0

I made a simple html page that when receiving the login and a password it send to another page where the data is checked, the problem is that when you put the character "+" in the password it just doesn’t arrive in the post, what comes is a blank " ".

The form header is so:

<form action="VerificaLogin.php"method="POST" enctype="multipart/form-data" accept-charset="iso-8859-1">

I already switched the charset to UTF-8 and did not give, already changed the enctype to application/x-www-form-urlencoded and it didn’t work either.

how can I solve this problem ?

  • Try placing a "/" bar before the "+"

  • 1

    Post more details of your code, both sending and receiving data...

  • Enter the code of VerificaLogin.php

  • I’m gonna test what the friend downstairs said, if I don’t, I’m gonna post the code here.

2 answers

1

You’re probably using some pair of quotes in the wrong place, your php must be getting the + as addition and not as a character.

1


I made a treatment with Javascript, before sending the request I use the function encodeURIComponent() to encode the password string before validating the login on the server, so I was able to use any kind of special character without problem.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.