Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Welcome extends CI_Controller {
- public function index()
- {
- /**
- * Já verifiquei o form:
- * <input type="text" name="user" id="user" value="teste" required>
- * <input type="text" name="pass" id="pass" value="123" required>
- *
- * URL (tentei estes):
- * http://localhost/codeigniter/index.php?user=teste&pass=123
- * http://localhost/codeigniter/index.php/user/teste/pass/123
- * http://localhost/codeigniter/user/teste/pass/123
- *
- * application/config/config.php:
- * enable_query_strings = TRUE e FALSE (tentei os dois)
- **/
- $this->load-view('form_login');
- }
- // Login 1
- public function login1()
- {
- // Esperado: 'teste'
- // Resultado: NULL
- $user = $this->input->get('user'); // NULL?
- $pass = $this->input->get('pass'); // 123
- echo 'FUNCIONOOOOU!<br>';
- echo $user, ' :: ', $pass; // :: 123
- }
- // Login 2
- public function login2()
- {
- // Esperado: '123'
- // Resultado: '123'
- $pass = $this->input->get('pass'); // 123
- // Esperado: 'teste'
- // Retornado: 'teste'
- $user = $this->input->get('user'); // teste? WHAT?
- echo 'FUNCIONOOOOU!<br>';
- echo $user, ' :: ', $pass; // teste :: 123
- }
- }
- // EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement