Im trying to get a send and received ajax coding, but im getting an error that preco is not an index in Complista2 page. This is the code:

the starting page:

```
$(function() {      
        $("#b1").click(function() {
            $.ajax({
                type: "POST",
                url: "complista2.php",
                data: $("#preco").val(),                
                success: $.get("complista2.php", function(data) {
                    $("#paramount").html(data);
                })
            });
        }); 
    });

<input id="preco" type="text" name="preco" value='250 AND 500'><br><br>

```

This is the Complista2 page:

```
<?php

$username = "root";
$password = "";
$server = "localhost";
$database = "VRealidade";
$conn = mysqli_connect($server, $username, $password, $database);
if (!$conn) {
    die("Erro: " . mysqli_connect_error());
} else {    
    }

$preco = $_GET['preco'];
$sql = "SELECT * FROM computadores WHERE preco BETWEEN $preco"; 
$result = mysqli_query($conn, $sql);
echo mysqli_error($conn);
$row = mysqli_fetch_assoc($result);
echo "<div class='entrada'>$row[nome]</div>"; 
while($row = mysqli_fetch_assoc($result)) {
    echo "<div class='entrada'>$row[nome]</div>";
}       

?>

```

EDIT : This is the form, but it bears no implication in this code.

```
<form id="pesqmenu2" method='GET'>
    <input id="preco" type="text" name="preco" value='250 AND 500'>
</form>

```