EllisLab text mark
Advanced Search
     
codeigniter post method
Posted: 05 October 2010 01:11 AM   [ Ignore ]
Joined: 2010-10-05
17 posts

Hi, i am new codeigniter..
I have created a form where the post method is working properly in IE but it is not working in firefox.
That is
This is my part of coding in view:
<form method=post action=‘addg’ name=‘myform’>
<input type=text name=‘pname’ id=‘pname’ value=’’ />
</form>
this my part of coding in controller
$pname=$this->input->Post(‘pname’);
  echo “name=$pname
“;


I used echo to check the values but i can get only empty values in firefox but with the same code i can get values in IE.
Can any one tell me where i got the problem…..

 
Posted: 05 October 2010 02:51 AM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2010-02-02
361 posts

Are u using CI’s form validation class. If not, try to use this…

More info: http://ellislab.com/codeigniter/user-guide/libraries/form_validation.html

 Signature 

ViewsBoard - For Sharing information and making discussion

Twitter | Facebook | Linkedin

 
Posted: 05 October 2010 03:57 AM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Joined: 2010-10-02
1 posts

hi,
i think your CI`s coding is properly incorrect.
first of all you check coding carefully then you tried it.
——————————————————————————————————————————————————————————
Earn an Extra $1000 to $1200 per month doing Part Time Data Entry Jobs! Work from home data entry jobs to post simple data submissions on Internet. Make $1 per entry. Easy form filling, data entry and ad posting jobs. No selling, No phone calls, No Marketing. No Investment. Bi-weekly payments. Full Training Provided. Pls visit:  Data-Entry 

 
Posted: 05 October 2010 05:49 AM   [ Ignore ]   [ # 3 ]   [ Rating: 0 ]
Joined: 2010-03-19
329 posts

I modified your code and now it prints value when button is clicked:

view:

<form method=post action='test_controller/write' name=‘myform’>
<
input type=text name='pname' value='' />
<?php echo form_submit();?>
</form

controller:

function index()
    
{
               
       $this
->load->view('test/test');
        
    
}
    
    
function write()
    
{
        
echo $this->input->post('pname');
    
 
Posted: 05 October 2012 12:32 PM   [ Ignore ]   [ # 4 ]   [ Rating: 0 ]
Joined: 2012-10-04
4 posts
SPeed_FANat1c - 05 October 2010 05:49 AM

I modified your code and now it prints value when button is clicked:

view:

<form method=post action='test_controller/write' name=‘myform’>
<
input type=text name='pname' value='' />
<?php echo form_submit();?>
</form

controller:

function index()
    
{
               
       $this
->load->view('test/test');
        
    
}
    
    
function write()
    
{
        
echo $this->input->post('pname');
    

i agree with coding above….I was try it grin

 
Posted: 07 October 2012 11:36 AM   [ Ignore ]   [ # 5 ]   [ Rating: 0 ]
Joined: 2012-10-07
1 posts

I’m working on a simple login form. When the user clicks on the Login button, I want to send the post values to my controller, validate them against my database (using a model) and return a value. Based on that value, I want to either send the user to the member area, or display an error message on my form. This error message has a class ‘error’ and is hidden by default. I want to use jQuery’s show() to show it when the credentials are wrong.

montreal office supplies