Welcome Guest, Not a member yet? Register   Sign In
Input->post problem
#1

[eluser]vishok[/eluser]
i'm a newbie of codeigniter. I have got the following problem when i try to get a value from a form. In a controller i wrote $this->input->post('varname') but if the value of varname is something like this "+39081545632" it return only "39081545632", i need also the "+".
How can i solve?
#2

[eluser]runrun[/eluser]
use $_POST['varname'] instead of $this->input->post(‘varname’) for this case.
#3

[eluser]flaky[/eluser]
I did a test (XSS filtering ON) and it worked for me
check it out
Code:
//Controller
class Blog extends Controller{

    function index(){
        $this->load->helper('form');
        $this->load->view('test_view');
        if($this->input->post('submit'))
            echo $this->input->post('phone_number');
    }

}

//View
<?php echo form_open('blog'); ?>
    <?php echo form_label('Phone'); ?>
    <?php echo form_input('phone_number'); ?>
    <?php echo form_submit('submit', 'Submit'); ?>
<?php echo form_close(); ?>




Theme © iAndrew 2016 - Forum software by © MyBB