Category: Php

Codeigniter Rewrite for nginx & apache

Rewrite Rules for nginx must be added into each domain’s configuration. location /path/to/project{ try_files $uri $uri/ /path/to/project/index.php?/$request_uri; } Rewrite Rules for apache can be added in the project’s .htaccess. RewriteEngine on RewriteCond $1 !^(index\.php|assets|images|js|css|uploads|favicon.png)...

Cron’s php script pathing issue

Php include/require pathing is related to how you run your script in cron for example you are having a PHP script in /var/www/html/phpscript/project1/index.php , And below is how the scripts include the files <?php...

Javascript redirection with post value (PHP)

fn_do_submit_post($url,$arr_post); function fn_do_submit_post($posting_url, $arr_post){ echo “<form action=’$posting_url’ method=’post’ name=’frm’>”; foreach ($arr_post as $a => $b){ echo “<input type=’hidden’ name='”.htmlentities($a).”‘ value='”.htmlentities($b).”‘>”; } echo “</form>”; echo “<script type=’text/javascript’>”; echo “document.frm.submit();”; echo “</script>”; }

Array Difference Between Large Arrays (PHP)

Hi, today i’ve encounter a two large array to be compare. Array 1 is around 50k data and Array 2 is around 500k data. So what i wanna eliminate is , If Array2’s data...

AWS SDK (PHP)

AWS SDK (PHP)

Hi, Today i am gonna talk about how to use SDK provided by aws (PHP). For aws SDK, they support few kind of languages such as Php, Android, IOS , Java, Python. For all...

How to prevent multiple ajax calling

1.Call a first function before calling second function(ajax) 2.In first function , check for a div with specific id’s length 3.In second function(ajax) most top append the div with specific id. Example: Event Scroll...