Category: Php

Apache Nginx 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) RewriteCond %(REQUEST_FILENAME) !-f RewriteCond %(REQUEST_FILENAME) !-d RewriteRule ^(.*)$ ./index.php/$1 [L]

Linux Php

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 include(“../include_1.php”); include(“../include_2.php”); ?> and below is how you run your script in cron. * * * * * php /var/www/html/phpscript/project1/index.php The […]

javascript 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>”; }

Aws Linux 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 the available language for sdk , Click Here You will have to import aws sdk files there are three kind of […]

javascript Php

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 to Bottom -> Call ajax: $(window).on(“scroll”, function() { if($(window).scrollTop() == $(document).height() – $(window).height()){ beforeajaxcalling(); } }); Function to be called before […]

Back To Top