这是我的View login.php
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Welcome</title>
<link rel="stylesheet" href="assets/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/css/signing.css">
<link rel="stylesheet" href="assets/js/bootstrap.min.js">
</head>
<body>
<div class="container">
<?php echo form_open('Login/validate_credentials',['class'=>'form-signin']); ?>
<h2 class="form-signin-heading">Please sign in</h2>
<label for="inputEmail" class="sr-only">Email address</label>
<input type="email" id="inputEmail" name ="username" class="form-control" placeholder="Email address" required autofocus>
<label for="inputPassword" class="sr-only">Password</label>
<input type="password" id="inputPassword" name="password" class="form-control" placeholder="Password" required>
<div class="checkbox">
<label>
<input type="checkbox" value="remember-me"> Remember me
</label>
</div>
<button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
</form>
</div> ``
这里看起来如何
的locahost / CI /
当我点击它时显示以下页面,。 apache日志和访问日志或mysql日志中没有错误 错误页面
控制器页面在这里 **
<?php
class Login extends CI_Controller{
public function index(){
$this->load->view('login');
}
public function validate_credentials()
{
$data =array(
$username=$this->input->post('username'),
$password=$this->input->post('password')
);
$this->load->model('Login');
$result=$this->login->validate($data);
if($result==true)
{
redirect('welcome');
}
else{
echo "not found";
}
}
}
?>
配置
$config['base_url'] = 'http://localhost:8080/ci';
$config['index_page'] = 'index.php';
routes.conf * /
$route['default_controller'] = 'login';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;
**
答案 0 :(得分:1)
将配置更改为
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
</head>
<body>
<div data-role="page">
<div data-role="header">
<p><a href="http://www.google.com">Go to google!</a></p>
</div>
<div data-role="main" class="ui-content">
<a href="#myPopupDialog" data-rel="popup" data-position-to="window" data-transition="fade" class="ui-btn ui-corner-all ui-shadow ui-btn-inline">Open Dialog Popup</a>
<div data-role="popup" id="myPopupDialog">
<div data-role="header">
<h1>Header Text</h1>
</div>
<div data-role="main" class="ui-content">
<p><iframe src="http://www.w3schools.com"></iframe>Go to w3school!</a></p>
<a href="#" class="ui-btn ui-corner-all ui-shadow ui-btn-inline ui-btn-b ui-icon-back ui-btn-icon-left" data-rel="back">Go Back</a>
</div>
<div data-role="footer">
<h1>Footer Text</h1>
</div>
</div>
</div>
<div data-role="footer">
<h1>Footer Text</h1>
</div>
</div>
答案 1 :(得分:0)
您的CI未正确设置。根据你的截图:
第一个屏幕截图网址:http://localhost/ci
第二个屏幕截图网址:http://localhost:8080/ci
更改您的配置:
$config['base_url'] = 'http://localhost/ci';
$config['index_page'] = 'index.php';