Welcome Guest, Not a member yet? Register   Sign In
use string helper with currency
#8

[eluser]Michael Nielsen[/eluser]
Ok but now I've submitted my form but I can't get it working just right.

Code:
function add()
    {
        $this->load->helper('form');
        $this->load->library('form_validation');
        $data['randomValue'] = random_string('alnum', 9);

        $this->form_validation->set_rules('productName', 'Product Name', 'required');
        $this->form_validation->set_rules('productPrice', 'Price', 'required');

        if ($this->form_validation->run() == FALSE)
        {
            $this->load->view('product_add', $data);
        }
        else
        {
            $price = '$'.$_POST['productPrice'];
            $this->db->insert('product', $_POST);
            echo 'Complete';
            echo $price;
        }
    }

If you look at the last line of the function I echo the price which comes out with the $ sign however it's been accepted into the db because it wasn't in the original $_POST.

Any solutions?


Messages In This Thread
use string helper with currency - by El Forum - 02-26-2009, 10:24 PM
use string helper with currency - by El Forum - 02-26-2009, 10:33 PM
use string helper with currency - by El Forum - 02-26-2009, 11:17 PM
use string helper with currency - by El Forum - 02-26-2009, 11:57 PM
use string helper with currency - by El Forum - 02-27-2009, 12:08 AM
use string helper with currency - by El Forum - 02-27-2009, 01:38 AM
use string helper with currency - by El Forum - 02-27-2009, 01:38 AM
use string helper with currency - by El Forum - 02-27-2009, 01:53 AM
use string helper with currency - by El Forum - 02-27-2009, 07:39 AM
use string helper with currency - by El Forum - 02-27-2009, 01:48 PM
use string helper with currency - by El Forum - 02-27-2009, 04:01 PM
use string helper with currency - by El Forum - 02-27-2009, 05:20 PM
use string helper with currency - by El Forum - 02-27-2009, 06:49 PM
use string helper with currency - by El Forum - 02-28-2009, 02:59 AM



Theme © iAndrew 2016 - Forum software by © MyBB