0

In a php page I found the below code:

<form class="form-inline mr-auto" method="post">

    <div class="input-group">

        <input type="text" class="form-control" required placeholder="Search Proposals" name="search_query" value="<?php echo @$_SESSION["search_query"]; ?>">

        <span class="input-group-btn">
            <button class="btn btn-primary" name="search" type="submit">
                <i class="fa fa-search"></i>
            </button>
        </span>

    </div>

</form>

<?php

if(isset($_POST['search'])){

    $search_query = $_POST['search_query'];

    $_SESSION['search_query']=$search_query;

    header("location: $site_url/search.php");

}

?>

if you notice then inside the form for input type text there is a php code for value attribute where a session has been called.

 value="<?php echo @$_SESSION["search_query"]; ?>">

But what is the at sing @ used for before $_SESSION["search_query"] ? is there any special meaning of at sign?

Rashedul Rough
  • 89
  • 1
  • 10

1 Answers1

-1

The @ sign suppresses errors in PHP.

https://www.php.net/manual/en/language.operators.errorcontrol.php

Bjorn 'Bjeaurn' S
  • 3,861
  • 2
  • 18
  • 29