form submit to blank page

46 views
Skip to first unread message

Mubin Khalid

unread,
Mar 31, 2014, 10:10:24 PM3/31/14
to codei...@googlegroups.com
Hi,
I'm new to CI and I created a basic form and when I try to submit it, it redirected to blank page,"about:blank"
I'm trying to post data to send method inside the email controller
something like that action = "<php echo base_url(); ?> index.php/email/send"
Please Let me know what I'm doing wrong
here is link to snapshot of page source

Thanks
Mubin

Nicolas OLIVIER, ON-Serv

unread,
Apr 1, 2014, 3:45:46 AM4/1/14
to codei...@googlegroups.com
Hi,
Have you try without the baseurl ?
OLIVIER Nicolas
On-Serv | Oxalis
06.17.71.17.77

Avant d'imprimer cet email, réfléchissez à l'impact sur l'environnement, merci!
--
You received this message because you are subscribed to the Google Groups "codeigniter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codeigniter...@googlegroups.com.
For more options, visit http://hau.r.mailjet.com/redirects/9pddhs8ljpvz8z9ty3wh8l/groups.google.com/d/optout.


007madsurfer

unread,
Jul 23, 2014, 9:47:07 AM7/23/14
to codei...@googlegroups.com
I am also very new to Codeigniter and i just did this these couple of days.

What you need is code like this in your view file that tells the submit button where to send your data:

 <?php
        echo form_open('index.php/your_controller/controllermethod', array('name' => 'myform'));   
    ?>

Then you also need to load the form library in autoload.php like this
$autoload['helper'] = array('html', 'url', 'form');

Then u catch it like this in your_controller:

$name = $this->input->post('input_text_name_from_your_form');

Hope it helps

Bhavani Dasari

unread,
Oct 16, 2014, 9:08:53 AM10/16/14
to codei...@googlegroups.com
hi, try this once

controller:
public function login(){
       
        //echo '<pre>';print_r($_POST);
       
        $userName=$_POST['Username'];
        $password=$_POST['Password'];
        $result=$this->College_Model->get();
        //echo '<pre>';print_r($result);exit;
        //echo $userName;
   
        if($userName == $result[0]['Username'] && $password == $result[0]['Password'])
        {       
            $this->load->view('success');
}
    else
{
        $this->load->view('failed');
}
}
view:
<form method="post" action="<?php echo site_url();?>/university/login" name="loginForm" id="loginForm">
model:
public function get() {
            $this->db->select('Username,Password');
            $this->db->from('uni_login');
            $query = $this->db->get();
            $result = $query->result_array();
            //echo '<pre>';print_r ($result);
            //$x=$result[0]['Username'];
            //echo $x;exit;
            return ($result);exit;
Reply all
Reply to author
Forward
0 new messages