PHP CodeIgniter自定义登录表单
我试图在PHP中使用CodeIgniter创建一个登录表单。我已经实现了功能,工作正常,但是我无法用自定义样式表为我的设置样式 以下是登录视图的代码:PHP CodeIgniter自定义登录表单,php,codeigniter,validation,login,Php,Codeigniter,Validation,Login,我试图在PHP中使用CodeIgniter创建一个登录表单。我已经实现了功能,工作正常,但是我无法用自定义样式表为我的设置样式 以下是登录视图的代码: <!DOCTYPE html> <html lang='en'> <head> <meta charset="UTF-8" /> <title> DTI Manager </title>
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset="UTF-8" />
<title>
DTI Manager
</title>
<link rel="stylesheet" type="text/css" href="/DTIManager/assets/css/style.css" />
</head>
<body>
<div id="wrapper">
<?php echo validation_errors();?>
<?php $attributes = array('class' => 'LoginController', 'id' => 'login-form');
echo form_open('LoginController/checkLogin', $attributes);?>
<form name="login-form" class="login-form" action="" method="post">
<div class="header">
<h1>Autentificare</h1>
<span>Pentru a accesa informatii despre comenzi transporturi trebuie sa fiti autentificat.</span>
</div>
<div class="content">
<input name="username" type="text" class="input username" placeholder="Utilizator" />
<div class="user-icon"></div>
<input name="password" type="password" class="input password" placeholder="Parola" />
<div class="pass-icon"></div>
</div>
<div class="footer">
<input type="submit" name="submit" value="Login" class="button"/>
</div>
</form>
</div>
<div class="gradient"></div>
</body>
</html>
我尝试将属性添加到form_open函数中,即表单的ID,但没有成功,按钮和字段仍然没有相应的样式
非常感谢您的任何提示。尝试在链接的css文件前回显基本url()
<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>DTIManager/assets/css/style.css" />
您有两个表单打开标记
echo form\u OPEN…
首先创建。另一个是纯html我理解,但如果我简单地让form_open函数对我没有帮助,因为我需要创建一个自定义登录表单form_open
只创建具有给定属性的form open标记(+如果启用了CSRF,则添加CSRF字段
)。您可以根据需要在echo form\u open()
和echo form\u close()
之间自定义输入(普通HTML/helper any都可以使用)。请在外部样式表的路径中尝试codeigniter的base\u url()或site\u url()函数。
<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>DTIManager/assets/css/style.css" />
RewriteCond $1 !^(index\.php|DTIManager|assets|robots\.txt|error\.html)