Welcome Guest, Not a member yet? Register   Sign In
Post form on current page
#1

[eluser]PHP Creative[/eluser]
Is it possible to post a forum inside the current function instead of a new one? For example the form process/validation code would be side the current function instead of writting a new function such as send/.
#2

[eluser]Dam1an[/eluser]
Yes, to process a form in the same function, do something like
Controller:
Code:
function sumbit_something() {
  // set rules here
  if($this->form_validation->run() == false) {
    // display the form
  } else {
    // process it
  }
}

View:
Code:
<form method="post">
// rest of form goes here

That will send it back to the same function, and hopefully pass validation and be processed in there

Is that what you where after?
#3

[eluser]PHP Creative[/eluser]
Yes that is what I was after. Thank a million Smile




Theme © iAndrew 2016 - Forum software by © MyBB