duplicate data when insert to db through form : the problem is when insert it duplicate the data like this in photo its added 2 times in Database[mysql table][1]
[page][2]


submit redirect to menu_submit when done insert it redirect to create_menu.php
here is 
menu_submit.php 

enter code here

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-html -->

    <?php
    include ("../include/layout/header.php");
    include ("../include/check_connection.php");
    include ("../include/check_page.php");

    if(isset($_POST["submit"])){
        $menu_name=$_POST["menu"];
        $optradio_choise=(int)$_POST["optradio"];
        $rank_name=(int)$_POST["rank"];
        $menu_name2=mysqli_real_escape_String($conn,$menu_name);
        //$query="INSERT INTO website_navbar(id,item_name,rank) values (null,'$menu_name',$rank_name)";
        $query=" INSERT INTO `website_navbar`( `item_name`, `rank`, `visible` ) VALUES
    	(    '{$menu_name}'    ,  '{$rank_name}'    ,    {$optradio_choise}     )     ";

        $result=mysqli_query($conn,$query);
        if(mysqli_query($conn,$query) && mysqli_affected_rows($conn)){
            echo "Menu add sucessfully";
            redirect1("mange_content.php");
            
    }

    }


    mysqli_close($conn);

    ?>

<!-- end snippet -->

`


  [1]: https://i.stack.imgur.com/vR6eF.png
  [2]: https://i.stack.imgur.com/CosBU.png