点#1 如果我键入:
www.myurl.com/somepage
http://www.myurl.com/somepage
http://myurl.com/somepage
https://myurl.com/somepage
Run Code Online (Sandbox Code Playgroud)
让它重定向到
https://www.myurl.com/somepage
Run Code Online (Sandbox Code Playgroud)
第2点
When I type in something like www.myurl.com it is redirecting to https://www.myurl.com/index.php.
Make it so the index.php is not displaying. It should just display https://www.myurl.com
Run Code Online (Sandbox Code Playgroud)
来自评论htaccess
RewriteEngine On
RewriteCond %{HTTP_HOST} ^myhost\.com$ [NC]
RewriteRule ^(.*)$ myhost.com/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /index\.php(/[^\ ]*)?\ HTTP/
RewriteRule ^index\.php(/(.*))?$ myhost.com/$2 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
Run Code Online (Sandbox Code Playgroud) 我试图能够使用引导进度条,以便它可以环绕我的图像围绕边缘的圆圈.
就像在html下面的代码中一样,我仍然宁愿像引导程序一样在div中设置宽度.
问题:如何使用bootstrap进度条包裹在我的图像中仍然可以在div中设置进度条?
这是我到目前为止所尝试的.Snippet 示例 Codepen
CSS
.progress {
border-radius: 50%;
}
.progress-bar {
border-radius: 50%;
}
.wrapper > img {
position: absolute;
top: 0;
left: 0;
text-align: center;
}
Run Code Online (Sandbox Code Playgroud)
HTML
<div class="container">
<div class="row">
<div class="page-header">Circle progress bar with image</div>
</div>
<div class="row">
<div class="col-lg-3 col-md-3 col-sm-3">
<div class="wrapper">
<img src="holder.js/150x150" class="img-circle img-thumbnail" />
<div class="progress" style="height: 150px; width: 150px;">
<div class="progress-bar" style="width: 50%"></div>
</div>
</div>
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud) 我在Xampp上安装了CI脚本.目前我正在处理表单,当我点击提交html时,它什么也没做.
我试过了
echo form_open('verifylogin');
echo form_open();
Run Code Online (Sandbox Code Playgroud)
它在源代码上显示为
<form action="http://::1/codeigniter/verifylogin">
<form action="http://::1/codeigniter/">
Run Code Online (Sandbox Code Playgroud)
分别.
我不明白这"http://::1/"
是什么以及如何摆脱它?
使用PHPSpreadsheet测试我在下面有我试过的代码.如果我在编写文件时使用xls,它似乎适用于MSOffice Excel.注意不使用Libre Office不会自动调整行需要它也可以与libre office一起使用.
$spreadsheet->getActiveSheet()->getRowDimension(1)->setRowHeight(-1);
foreach($spreadsheet->getActiveSheet()->getRowDimensions() as $rowID) {
$rowID->setRowHeight(-1);
}
Run Code Online (Sandbox Code Playgroud)
新控制器
<?php
require(APPPATH . 'vendor/autoload.php');
use PhpOffice\PhpSpreadsheet\Spreadsheet;
class Events extends MX_Controller {
public function test() {
$spreadsheet = new Spreadsheet();
$spreadsheet->getDefaultStyle()->getFont()->setName('Arial');
$spreadsheet->getDefaultStyle()->getFont()->setSize(24);
foreach(range('A','B') as $columnID) {
$spreadsheet->getActiveSheet()->getColumnDimension($columnID)->setAutoSize(true);
}
$spreadsheet->getActiveSheet()->getRowDimension(1)->setRowHeight(-1);
foreach($spreadsheet->getActiveSheet()->getRowDimensions() as $rowID) {
$rowID->setRowHeight(-1);
}
$spreadsheet->setActiveSheetIndex(0)
->setCellValue("A1",'Firstname')
->setCellValue("B1",'Lastname');
$spreadsheet->getActiveSheet()->setTitle('Users Information');
$spreadsheet->setActiveSheetIndex(0);
/* Here there will be some code where you create $spreadsheet */
// redirect output to client browser
header('Content-Type: application/vnd.ms-excel'); …
Run Code Online (Sandbox Code Playgroud) 我希望能够加入两张桌子togeather.
如何过,因为我我的论坛表有column "name"
和我forum_categories column "name"
我无法显示这两个名字.
在我的select()上如果我使用$this->db->select('f.name, fc.name', false);
它只显示来自forum_categories的名称
array(1) { [0]=> array(1) { ["name"]=> string(17) "News & Discussion" } }
问我如何从列和表中显示两个名称.
注意:我只希望能够$result['name']
在我的foreach循环中使用.
所以我希望它能成为现实
General
News & Discussion
Lounge
Run Code Online (Sandbox Code Playgroud)
我看过了
JOIN语句中的CodeIgniter ActiveRecord字段名称
模型
public function get_forums() {
$this->db->select('f.name, fc.name', false);
$this->db->from('forum as f');
// tried $this->db->join('forum_categories as fc', 'fc.forum_id = f.forum_id');
$this->db->join('forum_categories as fc', 'fc.forum_categories_id = f.forum_id');
$query = $this->db->get();
if ($query->num_rows() > 0) {
return $query->result_array(); …
Run Code Online (Sandbox Code Playgroud) 我想要一个像textarea中的每个换行符的计数器.这在上传大量网络横幅广告时使用,因此我需要一个简单的计数器来确定用户添加了多少.现在,只有当用户按下具有特殊bannerize的链接时,计数器才会起作用.
这是我现在的代码:
var i = 0;
$('.size').click(function(){
$('#total-number').text(i++);
return false;
});
Run Code Online (Sandbox Code Playgroud) 我正在使用CodeIgniter 日历库.
我有两个表,我从我的数据库中获取日历数据.
问题我有2个foreach循环与第二个foreach循环$query2->result_array()
它不让我从数据库表中获取每天的第一个事件extra_events
我也试图能够设置额外事件表的限制但不工作.
从extra_events
表中
例
Test 2 | Example 2
| Example 3
Run Code Online (Sandbox Code Playgroud)
它应该产生
Test 1 | Example 1 <!-- Missing
Test 2 | Example 2
| Example 3
Run Code Online (Sandbox Code Playgroud)
问我怎样才能确保为$ query2-> result_array()得到所有正确的结果.
图片
获得功能
public function get_events($year, $month) {
$calendar = array();
$this->db->select('*');
$this->db->from('events');
$this->db->where('year', $year);
$this->db->where('month', $month);
$query1 = $this->db->get();
foreach ($query1->result_array() as $event) {
$this->db->select('*');
$this->db->from('extra_events');
$this->db->where('events_id', $event['events_id']);
$this->db->where('year', $year);
$this->db->where('month', $month);
//$this->db->limit(2);
$query2 = $this->db->get();
foreach …
Run Code Online (Sandbox Code Playgroud) 我希望能够重定向到另一个控制器,但是当用户使用google登录并且成功完成时,它会被重定向到usercp但是由于某种原因它从这里结束时获得了#
http://www.example.com/test/google?code=4/sorrynocodeshown#
Run Code Online (Sandbox Code Playgroud)
当使用codeigniter redirect()重定向时,它会向其添加#.
http://www.example.com/usercp#
Run Code Online (Sandbox Code Playgroud)
问题成功登录后重定向到新页面时如何停止添加#.
我使用https://github.com/moemoe89/google-login-ci3
我也使用vhost和xammp
控制器功能
public function google() {
if ($this->input->get('code')) {
$googleplus_auth = $this->googleplus->getAuthenticate();
$googleplus_info = $this->googleplus->getUserInfo();
$google_data = array(
'google_id' => $googleplus_info['id'],
'google_name' => $googleplus_info['name'],
'google_link' => $googleplus_info['link'],
'image' => $googleplus_info['picture'],
'email' => $googleplus_info['email'],
'firstname' => $googleplus_info['given_name'],
'lastname' => $googleplus_info['family_name']
);
$login_google_userid = $this->login_model->login_with_google($googleplus_info['id'], $google_data);
$_SESSION['user_id'] = $login_google_userid;
redirect('usercp');
}
}
Run Code Online (Sandbox Code Playgroud)
config/googleplus.php设置
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$config['googleplus']['application_name'] 'Somename';
$config['googleplus']['client_id'] = '*****';
$config['googleplus']['client_secret'] = '*****';
$config['googleplus']['redirect_uri'] = 'http://www.mysetname.com/account/login/google';
$config['googleplus']['api_key'] …
Run Code Online (Sandbox Code Playgroud) 在我的bootstrap导航栏上,即使导航栏位于图像顶部,我也试图在页面上进行完整操作.
但我已经尝试了宽度100%.navbar-wrapper
和navbar
和navbar-default
,但由于某些原因,导航栏仍然不会去页的整个宽度.
实例
这是我的codepen Code View
这是我的codepen Full View
问题如何使导航栏宽度100%工作,使其达到页面的整个宽度?
CSS
/* Special class on .container surrounding .navbar, used for positioning it into place. */
.navbar-wrapper {
position: absolute;
top: 0;
right: 0;
width: 100% !important;
left: 0;
z-index: 20;
}
/* Flip around the padding for proper display in narrow viewports */
.navbar-wrapper > .container {
padding-right: 0;
padding-left: 0;
}
.navbar-wrapper .navbar {
padding-right: 15px;
padding-left: 15px;
width: 100% !important;
} …
Run Code Online (Sandbox Code Playgroud) 在CodeIgniter中我的安装应用程序routes.php我想检查是否存在两个文件并根据它们进行设置.
其中,如果文件存在则会升级,否则转到第一步.
有更好,更安全的方式吗?
$admin = dirname(FCPATH) . '/admin/config/database.php';
$catalog = dirname(FCPATH) . '/catalog/config/database.php';
if (file_exists($admin, $catalog)) {
$route['default_controller'] = "upgrade/index";
$route['404_override'] = '';
} else {
$route['default_controller'] = "step_1/index";
$route['404_override'] = '';
}
Run Code Online (Sandbox Code Playgroud) codeigniter ×7
php ×6
css ×2
html ×2
.htaccess ×1
counter ×1
google-api ×1
google-login ×1
jquery ×1
line-breaks ×1
phpexcel ×1
xampp ×1