Deny running batch files

100

Use users Group policy -> Prevent access to command prompt, there is an option to disallow batch scripts.

Self explanatory

Share:
100

Related videos on Youtube

krishk varma
Author by

krishk varma

Updated on September 18, 2022

Comments

  • krishk varma
    krishk varma over 1 year

    I am learning PHP and was trying to created dynamic pagination to show record form MySQL. The issue I'm facing is when I change number of record to be show by using SELECT tag it only works once after that it goes back to default value that i have set -> $limit = isset($_POST['records-count'])?$_POST['records-count']:"10"; which is 10.

    PHP

        include('../config/DbFunction.php');
        $obj = new DbFunction();
        
        $limit = isset($_POST['records-count'])?$_POST['records-count']:"10";
        $page = isset($_GET['page'])? $_GET['page']:"1";
        $start_data = ($page-1)*$limit;
        $rs = $obj->view_course($limit,$start_data);
        //print_r($limit); // to check limit value
        $course_row = mysqli_fetch_row($obj->view_course1());
        $total_records = $course_row[0];
        $total_page = ceil($total_records/$limit);
        $next = $page + 1 > $total_page? $total_page : $page +1;
        $prev = $page - 1 == 0? 1 : $page - 1;
        ?> 
    

    Form

    <form method="post" action="#">
        Records: <select name="records-count" id="records_count"> 
            <option disabled="disabled" selected="selected">Limit</option>
            <?php foreach([20,50,100,200] as $limit): ?>
            <option <?php if( isset($_POST["records_count"]) && $_POST["records_count"] == $limit) echo "selected" ?> value="<?= $limit; ?>"><?= $limit; ?></option>
            <?php endforeach; ?>
        </select>
    </form>
    

    Pagination

    <div class="pagination">
        <ul class="pagination pagination-default">
            <li class='page-item'><a class='page-link' href="view-course.php?page=<?= $prev; ?>">Previous</a></li>
            <?php     
                for ($i=1; $i<=$total_page; $i++) { 
                echo "<li class='page-item'><a class='page-link' href='view-course.php?page=".$i."'>".$i."</a></li>";
                } 
            ?>
            <li class='page-item'><a class='page-link' href="view-course.php?page=<?= $next; ?>">Next</a></li>       
        </ul>
    </div>
    
  • ExnnTech
    ExnnTech over 10 years
    It only stops users running cmd.exe They can still run batch files
  • week
    week over 10 years
    No, there is a sub-option to deny executing batch files.
  • krishk varma
    krishk varma over 3 years
    exactly I don't want the variable to b update on next request until I select the amount of record i want to view