Welcome Guest, Not a member yet? Register   Sign In
Problem with application after moving from local to hosting server
#11

[eluser]marcin_koss[/eluser]
I checked the app on a different hosting account(the same hosting provider). It behave the same way. Unfortunately I don't have access to hosting accounts from different provider.

The connection error happens when the array with the order items is being updated.
Below is the code that updates the order session.

Code:
$this->order = $this->session->userdata('order'); //saving order content to the array
        
        if(isset($_POST['submitted'])) {
        
            $order_array = $this->session->userdata('order');

            foreach($this->input->post('qty') as $k => $v) {
                $id = (int)$k;
                $qty = (int)$v;
                
                if (($qty == 0) || empty($qty)) { // delete product
                    unset($order_array[$id]);
                    }
                if ($qty > 0) {

                    $order_array[$id] = $qty;    
                }
            }
            $this->session->set_userdata('order', $order_array);

            $this->order = $this->session->userdata('order'); // Updated array is saved again to the session
        }

The already generated form that triggers the controller

Code:
<form action="http://www.zywiecshop.com/amtec_online2/index.php/orders/order_summary" method="post">

<table border="1" cellpadding="0" cellspacing="0" class="product_table">
<tr>
<th>No</th><th>Product Name</th><th>Qty</th></tr>

<tr>
<td>7</td><td>Product 1</td><td>&lt;input type="text" name="qty[7]" value="0" size="3"  /&gt;&lt;/td></tr>
<tr>
<td>20</td><td>Product 2</td><td>&lt;input type="text" name="qty[20]" value="0" size="3"  /&gt;&lt;/td></tr>
<tr>
<td>25</td><td>Product 3</td><td>&lt;input type="text" name="qty[25]" value="0" size="3"  /&gt;&lt;/td></tr>
<tr>
<td>18</td><td>Product 4</td><td>&lt;input type="text" name="qty[18]" value="0" size="3"  /&gt;&lt;/td></tr>
<tr>
<td>28</td><td>Product 5</td><td>&lt;input type="text" name="qty[28]" value="0" size="3"  /&gt;&lt;/td></tr>

</table>
&lt;input type="hidden" name="submitted" value="TRUE" /&gt;
&lt;input name="submitted" type="submit" value=" Go to order summary" alt="View Order" /&gt;
&lt;/form&gt;


Messages In This Thread
Problem with application after moving from local to hosting server - by El Forum - 05-22-2010, 07:07 PM



Theme © iAndrew 2016 - Forum software by © MyBB