我安装并设置了LAMP + PhpMyAdmin。我做了mod_rewrite等。现在我可以访问重写了,我做了权限。但是我可以在控制器中没有post的情况下访问它($ this-> input-> post('buton_ismi')),但是我无法使用它进行访问。请帮我。这是我的代码。它正在godaddy和ubuntu灯上工作。但不能在Arch Linux上的php7.1.4中工作
Depo.php(正在运行的Contoller-veriler()函数)
我正在使用http://localhost/belle/depo/veriler地址访问;
function veriler() {
$this->load->helper('url'); //url helper'dan base_url fonksiyonunu çekmek için çağırıyoruz
$this->load->library('session');
$this->load->model('depo_model');
$data['veri'] = $this->depo_model->hepsini_al();
$this->load->view('header');
$this->load->view('depo_view', $data);
$this->load->view('footer');
}
depo_view.php
<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>
<div class="container">
<div class="row">
<?php foreach($veri as $row){ ?>
<div class="col s6">
<div class="card blue-grey darken-1">
<div class="card-content white-text">
<span class="card-title"><?php echo $row->tour_nummer;?></span>
<p>
ID: <?php echo $row->id;?> </br>
Tour Nummer: <?php echo $row->tour_nummer;?> </br>
Name: <?php echo $row->name;?> </br>
Datum <?php echo $row->datum; ?> </br>
Ware Einladen: <?php echo $row->ware_einladen;?> </br>
Lager Ausfahrt: <?php echo $row->lager_ausfahrt;?> </br>
lager Ankunft: <?php echo $row->lager_ankunft;?> </br>
Bis: <?php echo $row->bis;?>
</p>
</div>
</div>
</div>
<?php } ?>
<a href="<?php echo base_url('Depo/indir'); ?>">Download result as CSV</a>
</div>
</div>
Depo.php(Contoller-ozel($ name)函数不起作用)我正在使用http://localhost/belle/depo/ozel/John-Doe地址访问;
public function ozel($name)
{
$this->load->helper('form');
$this->load->helper('url');
$this->load->library('session');
$this->load->model('depo_model');
if($this->input->post('buton_ismi'))//formda sumbit tuşuna basıldığında çalışacak fonksiyon
{
$this->depo_model->veri_ekleme_fonksiyonu(); //yeni elemanı database eklemek için model dosyamızı çağırıyoruz
}
if(isset($_FILES['fileToUpload']))//formda sumbit tuşuna basıldığında çalışacak fonksiyon
{
$ftU = $_FILES['fileToUpload'];
$name = $_SESSION['username'];
$data['errorcode'] = $this->depo_model->upload_resim($ftU, $name);
}
if(isset($_FILES['fileToUpload2']))//formda sumbit tuşuna basıldığında çalışacak fonksiyon
{
$ftU2 = $_FILES['fileToUpload2'];
$name = $_SESSION['username'];
$data['errorcode'] = $this->depo_model->upload_resim($ftU2, $name);
}
$data['name'] = $this->uri->segment(3);
$this->load->view('header');
$this->load->view('depo_ozel_view', $data);
$this->load->view('footer');
}
depo_ozel_view.php
<div class="container">
<br><br>
<!--h1 class="header center orange-text">Veri Ekle</h1-->
<div class="row">
<form action="<?php $urlname = $this->uri->segment(3); echo base_url('Depo/Ekle/'.$urlname); ?>" method="post" enctype="multipart/form-data">
<div class="col m4 s12">
Name: <input name="name_input" type="text" value="<?php echo $name; ?>" readonly>
</div>
<div class="col m4 s12">
Tour nummer: <input name="tour_nummer_input" type="text" required>
</div>
<div class="col m4 s12">
Datum: <input name="datum_input" type="text" value="<?php echo date("d-m-Y"); ?>" required>
</div>
<div class="col m3 s12">
Ware Einladen: <input name="ware_einladen_input" type="text" required>
</div>
<div class="col m3 s12">
Lager Ausfahrt: <input name="lager_ausfahrt_input" type="text" required>
</div>
<div class="col m3 s12">
Lager Ankunft: <input name="lager_ankunft_input" type="text" required>
</div>
<div class="col m3 s12">
Bis :<input name="bis_input" type="text" required>
</div>
<div class="col m6 s12">
Lieferschein Seite-1 :
<input name="fileToUpload" id="fileToUpload" type="file" accept="image/*" class="file-loading" required>
</div>
<div class="col m6 s12">
Lieferschein Seite-2 :
<input name="fileToUpload2" id="fileToUpload2" type="file" accept="image/*" class="file-loading" required>
</div>
<div class="center col m2 offset-m4 s12">
</br>
<button type="submit" name="buton_ismi" value="Sent" class="btn-large waves-effect waves-light orange">Abschicken</button>
</div>
</form>
</div>
</br>
<br><br>
</div>
这是http://localhost/belle/depo/ozel/John-Doe中的错误页面(Depo控制器/ ozel($ name)函数)
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Depo::$input
Filename: controllers/Depo.php
Line Number: 37
Backtrace:
File: /srv/http/belle/application/controllers/Depo.php
Line: 37
Function: _error_handler
File: /srv/http/belle/index.php
Line: 315
Function: require_once
An uncaught Exception was encountered
Type: Error
Message: Call to a member function post() on null
Filename: /srv/http/belle/application/controllers/Depo.php
Line Number: 37
Backtrace:
File: /srv/http/belle/index.php
Line: 315
Function: require_once
和第37行:
if($this->input->post('buton_ismi')) //formda sumbit tuşuna basıldığında çalışacak fonksiyon
我的.htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/?$1 [L]
access_log
::1 - - [16/Apr/2017:21:41:45 +0300] "GET /belle/depo/ozel/John-Doe HTTP/1.1" 500 1047
最佳答案
我们找到了解决方法。数组中的URI中的“ I to i”不能得到像“ uri”这样的低位字母。它正在将urI从核心变为核心。导致此问题的系统区域设置(例如mine tr_TR)。我将操作系统的语言环境更改为en_US。它正在解决此问题,核心文件中也有修复程序。在common.php修复问题中将mb_strtolower()添加到is_loaded()函数中。
关于php - Arch Linux上的LAMP中的Codeigniter,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/43439091/