• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Form Submission Error

#1
I am getting following error in form submission

The requested URL /CIExamples/Form_Submission/form/f1 was not found on this server.

form.php (controller)
<?php

    class Form extends CI_Controller
    {
        function __construct()
        {
            parent::__construct();
        }
        public function index()
        {
            $this->load->view('form_view');
        }
        public function f1()
        {
            echo 'form submitted';
        }
    }

?>






form_view.php (view)

<html>
<head>
<title>Form1</title>
</head>
<body>
  <h2>Form Submission Demo</h2>
  <?php echo form_open('form/f1/'); ?>
  <?php echo form_submit('submit', 'Submit'); ?>
  <?php echo form_close(); ?>
</body>
</html>
Reply

#2
Take the ending / off of your form_open
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply

#3
(06-25-2016, 02:17 AM)Kavita Wrote: I am getting following error in form submission

The requested URL /CIExamples/Form_Submission/form/f1 was not found on this server.

form.php (controller)
<?php

    class Form extends CI_Controller
    {
        function __construct()
        {
            parent::__construct();
        }
        public function index()
        {
            $this->load->view('form_view');
        }
        public function f1()
        {
            echo 'form submitted';
        }
    }

?>






form_view.php (view)

<html>
<head>
<title>Form1</title>
</head>
<body>
  <h2>Form Submission Demo</h2>
  <?php echo form_open('form/f1/'); ?>
  <?php echo form_submit('submit', 'Submit'); ?>
  <?php echo form_close(); ?>
</body>
</html>

Make sure you have set your base url and also with your file name of controller Form.php also on your controller you do not need close php tag remove ?>
There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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