[eluser]Unknown[/eluser]
my code is
in C:\wamp\www\books\application\views\view_login.php
<html>
<head>
[removed][removed]
[removed]
$(document).ready(function()
{
$('#login-button').click(function()
{
var username = $("#username").val();
var password=$("#passord").val();
var dataString = 'username='+username + ' ' + 'password='+password;
alert(username);
$.ajax({
type: "POST",
url: "http://localhost/edit/index.php/login/ajax/"+dataString,
data: dataString,
success: function(msg)
{
$("#status").html(dataString);
}
});
});
});
</script>
</head>
<form method="post">
username: <input type="text" name="username" id="username" /> <br />
password: <input type="passord" name="passord" id="passord" />
<input type="button" name="login" value="submit" id="login-button"/>
</form>
<div id="status"></div>
</html>
---------------------------------------------------------------------------
in C:\\wamp\\www\\books\\application\\controllers\\login.php
<?
class Login extends CI_Controller
{
function Login()
{
parent::__construct();
}
public function ajax()
{
$this->load->view('view_login');
echo '=>'.$this->input->post('username');
echo '=>'.@$_GET['username'];
}
}
?>
i can't get text box value in Controller. How can i get it please help me