• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
problem posting form to a file

i m new to CI.
I have built a form for user registration.
in form tag action is specified as a model..
but i get an error."class model not found"
any suggestions plz.

Without the tinniest jott of code, I can only assume. However, you did say:

[quote author="junaids" date="1239409085"]
in form tag action is specified as a model..
but i get an error."class model not found"[/quote]

Are you saying that you are referencing a model class as the action attribute of your form tag in html?

<form action='model'>

Welcome to the CodeIgniter forums!

The action attribute needs to point to a controller method. Controller methods are the only way to access your application from the outside. You can not access a model directly.

i have tried that too like,
&lt;form action="../controllers/signupform/registration" method="post"&gt;

but it doesnt work that way too

As far as your form is concerned, you are calling the controller name and method - not accessing it like you would a CSS file.

&lt;form action="&lt;?php echo site_url('signupform/registration'); ?&gt;" method="post"&gt;

I would strongly suggest you check out [url="http://ellislab.com/forums/viewthread/107773/"]this thread[/url]. It contains just about everything you should ever need to know to get you started with CodeIgniter.

i have accessed the code as u mentioned like a css file.
i autoloaded url helper, and also loaded it in the controller.
but i m getting an error on this line
"&lt;?php echo site_url('signupform/register'); ?&gt;"
Call to undefined function site_url() in C:\xampp\htdocs\codeigniter\system\application\views\signup.php on line 89

Oops, My bad! You'll need to load the url helper:


I wasn't suggesting that you access it like a CSS file, I was saying that this is how you were doing it, but shouldn't be. Smile

hi. i know that working with CI is quite simple. but at the moment i m stuck with this problem. so if u please help me out.
first i was writing the form tag as,
&lt;form action=”../controllers/signupform/registration” method=“post”&gt;
error"class controller not found"

and then like this,
&lt;form action="&lt;?php echo site_url('signupform/registration'); ?&gt;" method="post"&gt;
error"site_url() is undefined function"
i have loaded the url helper

where signupform is the controller and registration is the function
i m getting error on both of them
so if u please help me on this.

site_url() is defined in the URL helper, so as long as that's loaded first, you shouldn't have a problem.

Have you watched these tutorial videos? They are excellent! If not, I suggest you watch them. Even if you have, I suggest you watch them one more time. Smile

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.