Backend Development

How to prevent form hijacking in PHP?

Submitted by greatlogix, , Thread ID: 18592

Thread Closed
greatlogix
Newbie
Level:
0
Reputation:
0
Posts:
14
Likes:
1
Credits:
19
22-02-2016, 03:38 PM
#1
Hello

How to prevent form hijacking in PHP?

RE: How to prevent form hijacking in PHP?

Fragan
Offering a premium link generation servi
Level:
0
Reputation:
15
Posts:
129
Likes:
3
Credits:
55
22-02-2016, 07:15 PM
This post was last modified: 22-02-2016, 07:16 PM by Fragan
#2
Dont let Binladen enter to your site
Nah seriously , what do you mean by "Hijacking"? '-' Stealing data from your MYSQL db ?
[Image: ATWe5um.gif]

RE: How to prevent form hijacking in PHP?

kara
Junior Member
Supreme
Level:
0
Reputation:
12
Posts:
95
Likes:
19
Credits:
168
23-02-2016, 07:19 AM
#3
Check out this video. It is about cross-site request forgery, and how to protect against it.

RE: How to prevent form hijacking in PHP?

greatlogix
Newbie
Level:
0
Reputation:
0
Posts:
14
Likes:
1
Credits:
19
OP
23-02-2016, 01:33 PM
#4
Thanks loldongs. Very helpful video.
1

RE: How to prevent form hijacking in PHP?

0-Day
Novice
Level:
0
Reputation:
0
Posts:
23
Likes:
1
Credits:
7
01-03-2016, 03:16 PM
#5
Use mysqli_real_escape_string() or trim()

and sprinf() at mysql queries.

RE: How to prevent form hijacking in PHP?

Tropical
Fulltime Member
Level:
0
Reputation:
35
Posts:
1.04K
Likes:
54
Credits:
117
01-03-2016, 03:46 PM
#6
22-02-2016, 07:15 PM
Fragan Wrote:
Dont let Binladen enter to your site
Nah seriously , what do you mean by "Hijacking"? '-' Stealing data from your MYSQL db ?

Imagine him getting into your server and being like:

"It's going down!!!"

RE: How to prevent form hijacking in PHP?

eisenhim
Lurker
Level:
0
Reputation:
0
Posts:
4
Likes:
0
Credits:
4
21-04-2017, 09:19 PM
#7
Anything outside your server is outside your control. You must define what you want to let in at the border of your server, and not in the browser.

RE: How to prevent form hijacking in PHP?

HDPixel
Newbie
Level:
0
Reputation:
0
Posts:
15
Likes:
1
Credits:
9
02-08-2017, 01:16 AM
#8
sanitise all tags using strip_tags and htmlentities functions and sure PDO for the mysql connection.

RE: How to prevent form hijacking in PHP?

nikolay484
Newbie
Level:
0
Reputation:
0
Posts:
16
Likes:
0
Credits:
1
03-08-2017, 11:43 PM
#9
you mean sql injection or xss?
make escape for all data that you insert to db

RE: How to prevent form hijacking in PHP?

dev
Novice
Level:
0
Reputation:
0
Posts:
23
Likes:
2
Credits:
13
05-08-2017, 02:42 AM
This post was last modified: 05-08-2017, 02:45 AM by dev
#10
Sanitize inputs by using the trim($string) function to strip leading and trailing whitespace and the html_special_chars($string) function to escape HTML special characters by converting to HTML entities.
PHP Code:
$input html_special_chars(trim($_POST['input'])); 
And,properly escape the string using mysql_real_escape_string before substituting into your SQL query.

Users browsing this thread: 1 Guest(s)