Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function post(){
- $.post("<?php echo base_url();?>index.php/user/create", {username:"testUser",password:"userpassword"},function(data) {
- var test = data;
- });
- }
- public function create(){
- if($this->input->post('newuser')){
- $username = $this->input->post('username');
- $password = $this->input->post('password');
- echo json_encode(array('username'=>$username));
- }
- $.post("<?php echo base_url();?>index.php/user/create", {newuser: 1, username:"testUser",password:"userpassword"}...
- <script type="text/javascript">
- function post(){
- var url ="<?php echo base_url();?>index.php/user/create";
- $.post(url, {username:"testUser",password:"userpassword"},function(data) {
- console.log(data);
- var test = data;
- });
- }
- </script>
- public function create(){
- if($this->input->post('username')){
- $username = $this->input->post('username');
- $password = $this->input->post('password');
- echo json_encode(array('username'=>$username));
- }
- }
Add Comment
Please, Sign In to add comment