$ result does not shows in my view!!! HELP!!! |
[eluser]Bacu[/eluser]
I am stuck in this bug and I cannot solve it. I read already many times the user guide about form validation but I dont figure it out this problem. Please someone could help me. What I am doing wrong? I am using codeigniter 2.0. Error: A PHP Error was encountered Severity: Notice Message: Undefined variable: result Filename: views/home.php My controller: form.php Code: class Form extends CI_Controller My view: home.php Code: <form method=“post” action=“form”>
[eluser]toopay[/eluser]
Is this your actual code? Code: ... Code: // replace every ’...‘ with '...', eg :
[eluser]Bacu[/eluser]
Thank you. I dont know What happened. I've just copy and paste. What Am I doing wrong? I cannot figure it out. I am completly stuck. Best wishes. controller: form.php Code: class Form extends CI_Controller view: home.php Code: <form method="post" action="form">
[eluser]toopay[/eluser]
I mean in your actual code, not here. Are you done replace any ’‘ with '', in your actual code?
[eluser]Bacu[/eluser]
Yes! I did. I replaced all of them. :-( My code are between because I received this advice from this forum. Is it right? Thanks. controller:: form.php Code: class Form extends CI_Controller view:: home.php Code: <form method="post" action="form">
[eluser]alexaaaaaaaaaa[/eluser]
Nope that's not right i don't have time to figure out what are you doing but from what i know the code should be something like if butto if it pass validation $insertData = array(); $insertData['field_from_database'] = $this->input->post('field_from_form'); ..as many you want then $this->your_model->your_function($insertData); end if also take notice that you might want just to be sure that you hit the exact controller like this action="<?php echo site_url('form'); ?>" (good practice) ps ... write this <?php if(isset($data)) then echo ?>
[eluser]toopay[/eluser]
Code: <?php defined('BASEPATH') or die('No direct access script allowed');
[eluser]alexaaaaaaaaaa[/eluser]
look it'll allways say $result undefined ...becouse it's not ...it's when you fill the form that's why i told him look you must put a condition if(iseet($result)) echo $result; my oppinion...
[eluser]Luis ACE[/eluser]
I just tested your code & everything seems to be fine. When do you get the error? before or after you submit the form?
[eluser]Bacu[/eluser]
Luis! Thanks for your response. This erros is showed before. For example, I load the page www.myweb.local/home and this error is showed. I dont know what I am doing wrong. Cheers! A PHP Error was encountered Severity: Notice Message: Undefined variable: result Filename: views/home.php |
Welcome Guest, Not a member yet? Register Sign In |