本文整理汇总了PHP中verifyPath函数的典型用法代码示例。如果您正苦于以下问题:PHP verifyPath函数的具体用法?PHP verifyPath怎么用?PHP verifyPath使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了verifyPath函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: doUpload
function doUpload()
{
//informações para o template
$data = array('tipo' => $this->input->post('tipo'), 'logged' => $this->auth->logged(), 'page_title' => 'Upload', 'titulo' => 'UPLOAD DE FOTO E VÍDEO', 'description' => 'Efetuar cadastro', 'youtubclass' => 'youtub');
//só avalia o upload se for uma imagem
// Redifine as preferências baseado na decisão do usuário
$categoria = $this->config->item($this->input->post('imgcat'));
$this->upload->set_max_width($categoria['max_width']);
$this->upload->set_max_height($categoria['max_height']);
$upload_path = 'uploads/' . $this->input->post('imgcat') . '/' . $this->user->userID() . '/';
$this->upload->set_upload_path($upload_path);
verifyPath($upload_path);
if ($this->validation->run()) {
if ($data['tipo'] == 1 and !$this->upload->do_upload()) {
$this->messages->add($this->upload->display_errors('', ''));
} else {
$data += array('upload_data' => $this->upload->data());
if ($data['tipo'] == 1) {
$this->_createThumbnail($data['upload_data']['file_name']);
}
$id = $this->user->getUserIdByEmail($this->auth->userMail());
$media = $data['tipo'] == 1 ? $data['upload_data']['file_name'] : $this->input->post('userfile');
$dados_img = array('id_usuario' => $id, 'media_url' => $media, 'nome_img' => $this->input->post('nome'), 'local_img' => $this->input->post('local'), 'media_type' => $data['tipo'], 'media_category' => $this->input->post('imgcat'), 'dtcadastro' => date('Y-m-d H:i:s'));
$result = $this->user->gravaImg($dados_img);
if ($result) {
$this->messages->add("Dados inseridos com sucesso!", 'success');
}
}
$this->auth->clearCache();
redirect('profile', 'refresh');
} else {
$this->load->view('upload', $data);
}
$this->auth->clearCache();
}
开发者ID:nataliajulieta,项目名称:old,代码行数:35,代码来源:upload.php
示例2: liubo
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Contact: Lyubomir Arsov, liubo (at) web-lobby.com
*/
include '../system.inc.php';
include 'functions.inc.php';
verifyAction('MOVEDIR');
checkAccess('MOVEDIR');
$path = trim(empty($_GET['d']) ? '' : $_GET['d']);
$newPath = trim(empty($_GET['n']) ? '' : $_GET['n']);
verifyPath($path);
verifyPath($newPath);
if (is_dir(fixPath($path))) {
if (mb_strpos($newPath, $path) === 0) {
echo getErrorRes(t('E_CannotMoveDirToChild'));
} elseif (file_exists(fixPath($newPath) . '/' . basename($path))) {
echo getErrorRes(t('E_DirAlreadyExists'));
} elseif (rename(fixPath($path), fixPath($newPath) . '/' . basename($path))) {
echo getSuccessRes();
} else {
echo getErrorRes(t('E_MoveDir') . ' ' . basename($path));
}
} else {
echo getErrorRes(t('E_MoveDirInvalisPath'));
}
开发者ID:fzlrhmn,项目名称:sanitasi-salatiga,代码行数:31,代码来源:movedir.php
示例3: enviaArquivo
function enviaArquivo()
{
$upload_path = $this->config->item('upload_path') . 'arquivo/';
$this->upload->set_upload_path($upload_path);
$this->upload->set_max_width(0);
$this->upload->set_max_height(0);
$this->upload->set_max_filesize(0);
$this->upload->set_allowed_types($this->allowed);
$path = verifyPath($upload_path);
// Define o nome simplificado do arquivo
if (isset($_FILES['arquivo']['name'])) {
$_FILES['arquivo']['name'] = simplificaString($_FILES['arquivo']['name'], '_');
}
if (!$this->upload->do_upload('arquivo')) {
$this->messages->add($this->upload->display_errors());
return array();
} else {
$this->auth->clearCache();
return $this->upload->data();
}
}
开发者ID:nataliajulieta,项目名称:old,代码行数:21,代码来源:produto.php
示例4: liubo
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Contact: Lyubomir Arsov, liubo (at) web-lobby.com
*/
include '../system.inc.php';
include 'functions.inc.php';
verifyAction('UPLOAD');
checkAccess('UPLOAD');
$path = trim(empty($_POST['d']) ? getFilesPath() : $_POST['d']);
verifyPath($path);
$res = '';
if (is_dir(fixPath($path))) {
if (!empty($_FILES['files']) && is_array($_FILES['files']['tmp_name'])) {
$errors = $errorsExt = array();
foreach ($_FILES['files']['tmp_name'] as $k => $v) {
$filename = $_FILES['files']['name'][$k];
$filename = RoxyFile::MakeUniqueFilename(fixPath($path), $filename);
$filePath = fixPath($path) . '/' . $filename;
if (!RoxyFile::CanUploadFile($filename)) {
$errorsExt[] = $filename;
} elseif (!move_uploaded_file($v, $filePath)) {
$errors[] = $filename;
}
if (is_file($filePath)) {
@chmod($filePath, octdec(FILEPERMISSIONS));
开发者ID:fzlrhmn,项目名称:sanitasi-salatiga,代码行数:31,代码来源:upload.php
示例5: make_xls
function make_xls()
{
$ids = $this->input->post('edit');
$reminders = getReminders("lembrete_id in (" . implode(',', $ids) . ")");
$content = '';
foreach ($reminders as $item) {
// $status = $item['status']==0?'Não enviado':'Enviado';
// $content .= sprintf("<tr><td>%s</td><td>%s</td></tr>",$item['email'], $status);
$content .= sprintf("<tr><td>%s</td></tr>", $item['email']);
atualizaStatusLembrete($item['lembrete_id']);
}
$remindersHtml = "\n <table style='width:100%' summary='Lista de emails'>\n <thead>\n <tr>\n <th>Email</th>\n </tr>\n </thead>\n <tbody>\n {$content}\n </tbody>\n </table>";
$xlsUrl = $this->config->item('xls_path');
verifyPath($xlsUrl, 0777);
$xlsUrl .= 'lista_de_emails.xls';
//date("d-m-Y", time()).".xls";
file_put_contents($xlsUrl, utf8_decode($remindersHtml));
redirect('admin');
die;
}
开发者ID:nataliajulieta,项目名称:old,代码行数:20,代码来源:admin.php
注:本文中的verifyPath函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论