Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>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)</p> <pre><code>&lt;?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"; } } ?&gt; &lt;form name="vender" method="post" action="&lt;?php echo $_SERVER['PHP_SELF'];?&gt;"&gt; &lt;?php echo $identity; ?&gt; | &lt;?php echo $model; ?&gt; &lt;hr /&gt; &lt;input type="hidden" name="serial" value="&lt;?php echo $identity; ?&gt;" /&gt; &lt;input type="hidden" name="model" value="&lt;?php echo $model; ?&gt;" /&gt; &lt;input type="hidden" name="date" value="&lt;?php echo DATE('Y-m-d'); ?&gt;" /&gt; &lt;table style="font-size: 8pt;"&gt; &lt;tr&gt;&lt;td&gt;IEMI:&lt;/td&gt;&lt;td&gt;&lt;input class="form-sell" type="text" name="imei" /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Nombre: &lt;/td&gt;&lt;td&gt;&lt;input class="form-sell" type="text" name="name" /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Contacto: &lt;/td&gt;&lt;td&gt;&lt;input class="form-sell" type="text" name="contact" /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;NIF: &lt;/td&gt;&lt;td&gt;&lt;input class="form-sell" type="text" name="nif" /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Cantidad: &lt;/td&gt;&lt;td&gt;&lt;input class="form-sell" type="text" name="qty" /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Precio: &lt;/td&gt;&lt;td&gt;&lt;input class="form-sell" type="text" name="price" /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;input type="hidden" name="sub" value="submitted" /&gt; &lt;tr&gt;&lt;td&gt;&lt;input type="submit" /&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/table&gt; &lt;/form&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload