Skip to main content

Posts

All Html Special symbols code and ASCII code

All Html Special symbols code and ASCII code these are the all html special symbols  html code and ascii code .

Get user country and ip php and Cakephp

Get user country and ip php and Cakephp  Cakephp function to get ip and country of user public function getUserIpLocation()       {              $uinfo['userip'] = $this->request->clientIp();              $userip = $this->request->clientIp();                            $details = @json_decode(file_get_contents("http://freegeoip.net/json/".$userip));              $uinfo['usercountry'] = $details->country_name;              if($uinfo['usercountry']=="") { $uinfo['usercountry']="Unknown"; }              return $uinfo...

enable 2fa 2 step login authentication in cakephp 3

How to use 2fa google authentication  in cakephp 3 and above What is google authentication or 2 step verification google authentication or 2 step verification provide security to user account and enable 2 step security on thier account.user need to always insert a unique code generated by their phone app to login in thier account. this will prevent others to access their account even they have users login details. this tutorial will allow user to enable 2 factor google verfication into their accounts .and after this code user needs to follow these steps * click on enable 2fa link * download authi or google authenticator app * after click on enable 2fa link user able to view a page with a qr code and a key. user need to read qr code or enter key manually into their phone app . * and get a code from their phone and insert this code into the code field on same page.and if code is right then user 2fa google authentication or 2 step verificaiton will enabled for thier account...

Send mail using mail class in cakephp 3

Send mail using gmail smtp cakephp 3 to send mail using gmail in cakephp you nedd to follow these steps 1. open your yourproject/config/app.php 2. in your app.php replace 'EmailTransport' => [         'default' => [             'className' => 'Mail',             // The following keys are used in SMTP transports             'host' => 'localhost',             'port' => 25,             'timeout' => 30,             'username' => 'user',             'password' => 'secret',            ...

Convert numeric to roman numeric in php and jquery

Convert numeric to roman numeric in php and jquery  PHP Function to convert descimal numeric to roman numeric <?php    function getRomanNumeric($yournumber) { $n = intval($yournumber); $res = ''; $roman_numeric = array( 'M' => 1000, 'CM' => 900, 'D' => 500, 'CD' => 400, 'C' => 100, 'XC' => 90, 'L' => 50, 'XL' => 40, 'X' => 10, 'IX' => 9, 'V' => 5, 'IV' => 4, 'I' => 1); foreach ($roman_numeric as $roman => $numeric) { $matches = intval($n / $numeric); $res .= str_repeat($roman, $matches); $n = $n % $numeric; } return $res; } echo getRomanNumeric(2); ////Ouput of convert numeric to roman numeric - II ?>     jQuery function to convert decimal numeric to roman numeric  function convertToRoman(num) { var roman = ""; var l...

Show Instagram feeds to your website with php

How to Show Instagram feeds to your website with php Today we learn how to show instagram feeds and posts to on your website so here is the code for show instagram feeds or posts to on your website .. Requirements Access Token Instagram ID Instagram Account <?php //$userid = "1234567893"; //get this from your instagram account //$accessToken = "798592023.85b53d1.49047a4fcd1b4aebad2e67a56f57f8cc"; //instagram account $url = "https://api.instagram.com/v1/users/{$userid}/media/recent/?access_token={$accessToken}"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 20); $result = curl_exec($ch); curl_close($ch); $result = json_decode($result); ?> <ul> <?php $i=1; foreach ($result->data as $post): ?>     <?php  if($i>5){ break;} ?>     <li><a class="" href="<?php echo $post->images->standard_resolution->ur...

use other characters to show password javascript

  How to use other characters to show password javascript         By default whenver we start to type in password field its automatically changed into Asterisk character or sign . but sometimes we need to show password characters into another pattern or format ...like (#####) or a number or a character. So today we learn how to change a textbox field pattern and how to use other character or special symbol to show password. So here is the javascript function and code that will change your input box pattern to show password. In this example we show our password in hash format. <html> <head> <title></title> <script type="text/javascript">    var k=0;    var df; window.onload=function() {    df=document.forms[0]; df[1].onkeyup=function() { df[0].value+=df[1].value.charAt(k);    k++; for(c=0;c<df[1].value.length;c++) {    df[1].value=df[1].va...