I have a form and on submit, it goes to submit.php.
The input text looks like this:
<input name="hpno[1]" type="text" maxlength="3" size="3" /> - <input name="hpno[2]" type="text" maxlength="8" size="13" />
I need to store the data as per this format (010) 5839539.
Tried putting this in the submit.php
$hpno = implode(‘-‘, $_POST[‘hpno’]); but this gives the output 010-5839539.
Any help would be much appreciated.
You could help to prevent an SQL injection like this:
This will give you the formatting you need and scrub the input (though it’s not perfect, or bullet-proof).