Welcome Guest, Not a member yet? Register   Sign In
redirection problem

Can anyone tell me how to redirect to the function that has argument ?

I want to redirect after inserting in table like this,

function Addproperty($propertyid){
....code here

function insert(){

$data=....To model-->function Addinsert



Neither it is redirected nor it refreshes. I am getting header information error.

I tried this also

redirect('/Addproperty/'.$propid,''); , but no use.

Any suggestions ?

[eluser]Thorpe Obazee[/eluser]
nvm me.

its very simple, the syntax of redirect is redirect('controllername/property/param')

.... read the documentation.....

Make sure in your model function you return the last id after inserting.
Then in your controller:
function insert()
  $propid = $this->Model->do_the_insert();
     redirect('same_controller/addproperty/'.$propid, 'refresh');
Always make sure you are getting the $propid after inserting, otherwise don't do the redirect.Do some testing to see what you are getting for it.
$propid = $this->Model->do_the_insert();
echo $propid;

Theme © iAndrew 2016 - Forum software by © MyBB