• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fatal error: Call to undefined function redirect()

#1
[eluser]Rocky Mehta[/eluser]
<code>
if ($this->input->post('upload'))
{
if ($this->input->post('capacity_view_id'))
{
$this->venue_capacity_model->do_upload();
$data['capacity_image'] = $this->venue_capacity_model->get_images();
$this->venue_capacity_model->update_capacity($_FILES['userfile']['name']);
echo "Data Updated Successfully";
redirect('http://localhost/venue/index.php/venue_capacity/update/');
}
else
{
$this->venue_capacity_model->do_upload();
$data['images'] = $this->venue_capacity_model->get_images();
$this->venue_capacity_model->insert_capacity($_FILES['userfile']['name']);
echo "Data Inserted Successfully";
}
}
</code>

Data Updated Successfully
Fatal error: Call to undefined function redirect() in D:\www\vhosts\localhost\venue\application\controllers\venue_capacity.php on line 25
Its give me error like this.

I am try to simple redirect my page but not working. please gave me solution how can i redirect my page.

#2
[eluser]Silviu[/eluser]
redirect() is defined in the url_helper. Have you loaded it in your method/controller or autoload?


Hint: you can use the [ code ]my code[ /code ] tags to get a nicer output for your code:
Code:
if ($this->input->post(‘upload’))
{
  if ($this->input->post(‘capacity_view_id’))
  {
$this->venue_capacity_model->do_upload();
$data[‘capacity_image’] = $this->venue_capacity_model->get_images();
$this->venue_capacity_model->update_capacity($_FILES[‘userfile’][‘name’]);
echo “Data Updated Successfully”;
      redirect(‘http://localhost/venue/index.php/venue_capacity/update/’);
  }
  else
  {
$this->venue_capacity_model->do_upload();
$data[‘images’] = $this->venue_capacity_model->get_images();
$this->venue_capacity_model->insert_capacity($_FILES[‘userfile’][‘name’]);
echo “Data Inserted Successfully”;
  }
}

The interpreter is not perfect, but it's better than basic text styling Smile

#3
[eluser]InsiteFX[/eluser]
If you use POST REPLY then you get the full editor! But everyone just clicks on FAST REPLY

#4
[eluser]Silviu[/eluser]
Offtopic
You cannot "fast reply" when creating a new topic Smile Besides, if you hit fast reply you get a nice 'use the code tags' hint, which is not present when the full editor is opened.

Ontopic
@Rocky Mehta: did my hint worked for you?

#5
[eluser]InsiteFX[/eluser]
And they still do not use it besides I was talking about commenting on a topic!

#6
[eluser]Rocky Mehta[/eluser]
in the config/autoload.php
i m write this sentence and its work.

Code:
$autoload['helper'] = array('url', 'file');



Sorry for late reply is a internet problem last 8-hours so i can't reply as fast.
Thank x once again sir.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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