You can't echo anything out once the headers have been sent, since the server is finished dealing with the page when the headers are sent. There are a couple solutions that you can implement here. You could send data back to index using a GET variable, POST variable, SESSION, maybe even a cookie, or you can have the request performed from within the index.php using ajax so that you never actually leave the index page. Here's a simple solution: (Note, you need to remove your redirect in sell.php. Everything takes place in index.php this way)
<?php
$successfulSubmit = FALSE;
if (!empty (@$_POST["sub"]))
{
include "sell.php";
$successfulSubmit = //some logic to verify data was successfully submitted
if ($successfulSubmit)
{
echo "Data submitted successfully";
}
else
{
echo "Data submitted unsuccessfully";
}
}
?>
<form name="vender" method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
<?php echo $identity; ?> | <?php echo $model; ?>
<hr />
<input type="hidden" name="serial" value="<?php echo $identity; ?>" />
<input type="hidden" name="model" value="<?php echo $model; ?>" />
<input type="hidden" name="date" value="<?php echo DATE('Y-m-d'); ?>" />
<table style="font-size: 8pt;">
<tr><td>IEMI:</td><td><input class="form-sell" type="text" name="imei" /></td></tr>
<tr><td>Nombre: </td><td><input class="form-sell" type="text" name="name" /></td></tr>
<tr><td>Contacto: </td><td><input class="form-sell" type="text" name="contact" /></td></tr>
<tr><td>NIF: </td><td><input class="form-sell" type="text" name="nif" /></td></tr>
<tr><td>Cantidad: </td><td><input class="form-sell" type="text" name="qty" /></td></tr>
<tr><td>Precio: </td><td><input class="form-sell" type="text" name="price" /></td></tr>
<input type="hidden" name="sub" value="submitted" />
<tr><td><input type="submit" /></td></tr>
</table>
</form>