我正在尝试创建以下语句:
select * from donors where field is NOT NULL;
Run Code Online (Sandbox Code Playgroud)
使用codeigniter,我的代码如下所示:
$where = ['field' => NULL];
$this->db->get_where('table', $where);
Run Code Online (Sandbox Code Playgroud) 我尝试用jQuery做多个输入图像预览.预览图像工作正常,但同一div中的图像预览,我需要在不同的div中的每个图像预览.我该怎么做?
HTML
<html>
<form action="index.php" id="myForm" name="myForm" enctype="multipart/form-data" method="post" accept-charset="utf-8">
desktop:<input type="file" id="files" name="files" multiple><br/>
<div id="selectedFiles"></div>
mobile:<input type="file" id="mobile" name="mobile" multiple><br/>
<div id="selectFiles"></div>
<button type="submit">Submit</button>
</form></br></body>
</html>
Run Code Online (Sandbox Code Playgroud)
custom.js
$(document).ready(function() {
/*multiple image preview first input*/
$("#files").on("change", handleFileSelect);
selDiv = $("#selectedFiles");
$("#myForm").on("submit", handleForm);
$("body").on("click", ".selFile", removeFile);
/*end image preview */
/* Multiple image preview second input*/
$("#mobile").on("change", handleFileSelect);
selDivM = $("#selectFiles");
$("#myForm").on("submit", handleForm);
$("body").on("click", ".selFile", removeFile);
/*end image preview*/
)}
Run Code Online (Sandbox Code Playgroud)
Handle File Select的方法函数
var selDiv = "";
var …Run Code Online (Sandbox Code Playgroud) 我用codeigniter创建了一个登录页面,但是我收到了php消息.
Message: ini_set(): A session is active. You cannot change the session module's ini settings at this time
怎么解决这个问题?
查看(login.php)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Admin Login</title>
<link rel="stylesheet" href="../css/normalize.css">
<link rel="stylesheet" href="../css/admin-style.css">
</head>
<body>
<?php echo form_open('Verify_login', ['id'=>'loginForm', 'name'=>'loginForm', 'method'=>'post']) ?>
<div class="login">
<div class="log-box">
<h3>Login</h3>
<div >
<input id="username" name="username" placeholder="User Name" value="" type="text" >
<?php echo form_error('username'); ?>
<input id="Password" name="password" placeholder="Password" required type="password">
<?php echo form_error('password'); ?>
<div class="remember-me">
<input id="checkBox" type="checkbox">
<label for="checkBox">Remember …Run Code Online (Sandbox Code Playgroud) 请通过下面的代码
为什么第三个月两次而不是第二个月。代码
('current ' . Carbon::now()->format('Y-m-d'));//2021-04-30
('sub 1 -'.Carbon::now()->subMonths(1)->format('Y-m-d'));
('sub 2 -'.Carbon::now()->subMonths(2)->format('Y-m-d'));
('sub 3 -'.Carbon::now()->subMonths(3)->format('Y-m-d'));
Run Code Online (Sandbox Code Playgroud)
结果
current 2021-04-30
sub 1 - 2021-03-30
sub 2 - 2021-03-02
sub 3 - 2021-01-30
Run Code Online (Sandbox Code Playgroud)
预期结果
current 2021-04-30
sub 1 - 2021-03-30
sub 2 - 2021-02-02
sub 3 - 2021-01-30
Run Code Online (Sandbox Code Playgroud) 尝试使用 jQuery 显示选定的图像并在单击图像时删除图像。
单击时删除图像工作正常,实际上问题是它不会从表单中删除。
$(document).ready(function() {
/*multiple image preview first input*/
$("#files").on("change", handleFileSelect);
selDiv = $("#selectedFiles");
$("#myForm").on("submit", handleForm);
$("body").on("click", ".selFile", removeFile);
/*end image preview */
});
var selDiv = "";
// var selDivM="";
var storedFiles = [];
function handleFileSelect(e) {
var files = e.target.files;
var filesArr = Array.prototype.slice.call(files);
var device = $(e.target).data("device");
filesArr.forEach(function(f) {
if (!f.type.match("image.*")) {
return;
}
storedFiles.push(f);
var reader = new FileReader();
reader.onload = function(e) {
var html = "<div><img src=\"" + e.target.result + "\" data-file='" + …Run Code Online (Sandbox Code Playgroud)我目前正在使用codeigniter 3.0.3。我试图使用var_dump(base_url());函数来获取基本URL,
我得到了这个结果
字符串' http:// localhost / '(长度= 17)
但是我需要获取带有端口号的基本URL。我在codeigniter 3.0.2中得到了这样的代码
字符串' http:// localhost:8000 '
如何在Codeigniter 3.0.3中获取带有端口号的基本URL。
php ×3
codeigniter ×2
javascript ×2
jquery ×2
apache2 ×1
laravel ×1
mysql ×1
php-carbon ×1
session ×1