0 like 0 dislike
11 views
Function for sql injection
asked Dec 13, 2018 in Education & Reference by Marc (2,430 points) | 11 views
    

1 Answer

0 like 0 dislike
//Function for sql injection
function sqlInjection($data){
$data = stripslashes($data);
$date = mysqli_real_escape_string($data);
return $data;   
}

USAGE

// To protect MySQL injection
$email = sqlInjection($email);
$password = sqlInjection($password);
$sql="SELECT * FROM users WHERE email='$email' and password='$password'";
$result=mysqli_query($con,$sql);
answered Dec 13, 2018 by anonymous

Related questions

0 like 0 dislike
0 answers
asked Jun 13, 2018 in Education & Reference by Sam (1,360 points) | 44 views
1 like 0 dislike
1 answer
asked Jan 4, 2018 in Education & Reference by Sam (1,360 points) | 178 views
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
asked Aug 2, 2018 in Education & Reference by Sam (1,360 points) | 46 views
0 like 0 dislike
1 answer

Where your donation goes
Technology: We will utilize your donation for development, server maintenance and bandwidth management, etc for our site.

Employee and Projects: We have only 15 employees. They are involved in a wide sort of project works. Your valuable donation will definitely boost their work efficiency.

How can I earn points?
Awarded a Best Answer 10 points
Answer questions 10 points
Asking Question -20 points

Mathe Forum Schule und Studenten
1,179 questions
1,319 answers
277 comments
1,638 users