Results 1 to 6 of 6

Thread: Prevent PHP Form Hijacking

  1. #1
    Join Date
    Nov 2009
    Posts
    1,340

    Prevent PHP Form Hijacking

    Hello, I am beginner in PHP language and want to improve my knowledge about it. Can anyone give me solution from which I can able to prevent my php form from Hijacking. If anyone knows then please give me reply about the same.

  2. #2
    Join Date
    May 2008
    Posts
    2,389

    Re: Prevent PHP Form Hijacking

    You can prevent you PHP Form from Hijacking by the means of various ways as below:
    1. You need to off the register_globals which will prevent injection of malicious code.
    2. Error_reporting must be set to E_ALL so before using any variable it is needed to initialize it.
    3. You can make use of the htmlentities(), strip_tags(), utf8_decode() and addslashes() for filtering Unauthorized data.
    4. Use mysql_escape_string() in mysql.

  3. #3
    Join Date
    Feb 2008
    Posts
    1,852

    Re: Prevent PHP Form Hijacking

    You need to add the code below to stop the email injection:
    Code:
    if ( preg_match( "/[\r\n]/", $name ) || preg_match( "/[\r\n]/", $email ) ) {
    //Error message
    }

  4. #4
    Join Date
    Jan 2008
    Posts
    1,521

    Re: Prevent PHP Form Hijacking

    use the steps below to Prevent PHP form Hijacking:
    • You need to use the form processing which will able to find the submitted characters and then clear the spaces and breaks from the email headers.
    • You need to review the data from the email.
    • It is needed to use the script for data validation.

  5. #5
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Prevent PHP Form Hijacking

    Follow the steps below to prevent PHP form Hijacking:
    • Turn off the register_globals.
    • Make E_ALL for Error_reporting.
    • Make scripts for data validation and data verification.
    • Make use of htmlentities(), strip_tags(), utf8_decode() and addslashes() as filters.

  6. #6
    Join Date
    May 2008
    Posts
    2,012

    Re: Prevent PHP Form Hijacking

    Prevent PHP Form Hijacking from the following:

    User Input Sanitization:
    You need to track the data from the user before submission.
    Form Submision Key Validation:
    You need to validate the submission key.
    SQL injection attacks by using mysql_escape_string() :
    Dont make use of the mysql_escape_string() to avoid the PHP Form Hijacking.

Similar Threads

  1. Replies: 5
    Last Post: 25-05-2011, 10:21 PM
  2. DNS hijacking in Airtel broadband
    By Jagad in forum India BroadBand
    Replies: 4
    Last Post: 12-05-2011, 02:59 PM
  3. Replies: 2
    Last Post: 02-05-2011, 07:06 AM
  4. Bing Hijacking
    By Chestery in forum Technology & Internet
    Replies: 4
    Last Post: 11-09-2010, 06:12 PM
  5. What Is Session Hijacking and is it Possible?
    By Abraham.J in forum Networking & Security
    Replies: 2
    Last Post: 22-12-2008, 05:38 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,579,536.60256 seconds with 16 queries