Showing posts with label CodeIgniter. Show all posts
Showing posts with label CodeIgniter. Show all posts

mengatasi error escapeshellarg() disabled di codeigniter

Wednesday, February 13, 2013

Baru kali ini bermasalah dengan library "Upload"  nya codeigniter, muncul notifikasi kesalahan "escapeshellarg() has been disabled for security reasons".

Sebabnya ? fungsi tersebut dinonaktifkan oleh pemilik server. Solusinya ? selain menghubungi admin server dan meminta untuk mengaktifkan fungsi escapeshellarg , bisa juga dengan membuat sendiri kode untuk pengganti fungsi tadi. Menurut dualed di thread ini fungsi escapeshellarg()  sangat simpel ,  "only escapes any single quotes in the given string and then adds single quotes around it" . Nah, kode yang perlu dibuat: seperti dibawah ini :


function my_escapeshellarg($input)
{
  $input = str_replace('\'', '\\\'', $input);

  return '\''.$input.'\'';
}

tinggal taruh fungsinya di library upload (/system/libraries/)

sudah itu saja 

...Baca Terusannya

Ftp Upload Via Web Form In Codeigniter

Wednesday, November 12, 2008

Just recently i've managed to use Codeigniter's FTP class to upload file from my admin page,using web form that is, the concept is easy
first,took the file path using Codeigniter's Upload Class (Ftp Class won't get the full path)
second,upload it using FTP (code igniter also have its own Ftp Class)


in order to do so ,i've modified my upload class ,so that it will upload uisng ftp instead of moving file
here's the line of interest


if ( !$CI->ftp->upload($this->file_temp, $this->upload_path.$this->file_name))
{
$this->set_error('upload_destination_error');
return FALSE;
}
$CI->ftp->close();


don't forget to load the ftp library n get it connected like this

$CI =& get_instance();
$CI->load->library('ftp');
if( $CI->ftp->connect())

n thats it,now you can use Codeigniter's Ftp class to upload file from a web form :D

...Baca Terusannya

Greybox in CodeIgniter

Friday, November 7, 2008

Having a trouble using GreyBox in CodeIgniter ?
Yesterday,when i was studying CodeIgniter and intend to implement Greybox in it, i came up on that.
My greybox won't show up and just showing the linked page,no animation whatsoever.
i've been going through the installation documentation myself.

How could it be?,i thought i've made some typo, so i tried to just copy and pasted
the example code from GreyBox documentation,but it still won't work .

Later on,i launch my Chrome, and have it to inspect my code, a red sign came up.
apparently somehow, the GB_ROOT_DIR variable can't be read by Greybox's javascript ,so what i do is deleted this code from my header template


<script type="text/javascript">
var GB_ROOT_DIR ="http://localhost/assets/js/greybox/"
</script>


and then added a GB_ROOT_DIR with the link to my greybox folder to gb_scripts.js
which located inside the greybox folder like this

var GB_ROOT_DIR_="http://localhost/assets/js/greybox/";

and it worked like a charm, i'm using that solution till now
so that was my way of using Greybox in Codeigniter
if you do have another solution,share it with us ;)

...Baca Terusannya

  © Blogger template Newspaper by Ourblogtemplates.com 2008

Back to TOP