title: Codeigniter adding data to database and then process it
body: <p>I am using codeigniter to built a type of online shop.
  I want to create a process order function in order to verify the details of the order the clients puts in.</p>
  
  <p>I am stuck though because on the last page i have the data to submit and when i click i go to main/process_order where i insert the data in the table and then use curl to comunicate with another server.</p>
  
  <p>My question is: when i hit submit and then stop on the process_order page if i reload it 1000 times, the table will be filled with the same 1000 lines, so this can be a security issue. Also if i make a function to add the data to db and then redirect to process_order it will be another issue because i still need my data that was posted.</p>
  
  <p>What's the best way to solve this. I hope i made it as clear as i can.
  Code: </p>
  
  <pre><code>$data=array(        
          'userid' =&gt; $userid,
          'email' =&gt; $email_data,   
          'phone' =&gt; $this-&gt;input-&gt;post('phone'),
          'discount' =&gt; $this-&gt;input-&gt;post('discount'),       
          'price' =&gt; $this-&gt;input-&gt;post('price'),
          'final_price' =&gt; $this-&gt;input-&gt;post('final_price'),
          'client_data' =&gt; $this-&gt;input-&gt;post('client_info'),
          'client_ip' =&gt; $this-&gt;input-&gt;post('client_ip'),
          'time' =&gt; $date
          );
  
      $this-&gt;db-&gt;insert('orders_temp', $data); 
  </code></pre>