

PHP/MySQL- Escape All POST Or GET Variables For MySQL INSERT
I’m quickly going to demonstrate how to escape special characters in a string for all POST/GET variables safe for a MySQL INSERT query when passing values from a HTML form.
So, let’s say we have a form like this on index.php:
Details
First Name:
Surname:
Email:
View Code HTML1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<form action="insert.php" method="POST">
<fieldset>
<legend>Details<legend>
<div>
<label>First Name:</label>
</div>
<div>
<input type="input" name="first_name" value="Bright" disabled="disabled" />
</div>
<div>
<label>Surname:</label>
</div>
<div>
<input type="input" name="surname" value="Cherry" disabled="disabled" [...]
Maruf scribbled this post.











