How to Disable WP JSON Rest API in WordPress without plugin ?

just add below code in wordpress theme function.php file at the bottom

--------------------------------------------------
Add the following code to functions.php (anyone)
--------------------------------------------------


if( ! is_user_logged_in() ) {
remove_action('rest_api_init', 'create_initial_rest_routes', 99);
}


-----------------------------------
OR
-----------------------------------


remove_action('rest_api_init', 'create_initial_rest_routes', 99);

------------------------------------------
Check if your site's username is exposed
------------------------------------------
website-URL.com/wp-json/wp/v1/users
website-URL.com/wp-json/wp/v2/users
website-URL.com/wp-json/
remove_action('rest_api_init','create_initial_rest_routes',99);

open image in new popup window

<a href="javascript:void(0);" onclick="openwin('https://basantmallick.com/admin/popup.php?img=category-images/Medical-Equipment-On-Rent-Purchase.jpg', '530', '580')" class="linkgray fontbold"><strong>View Image</strong>
                  
     </a>

<script>
function openwin(file,Iwidth,Iheight) {
	var newWin1=window.open(file,'nWin2','x=0,y=0,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,copyhistory=no,width='+Iwidth+',height='+Iheight+',screenX=0,screenY=0,left=20,top=20');
}

</script>
How to change date format in PHP?

How to change date format in PHP?

to convert the date-time layout Hypertext Preprocessor presents strtotime() and date() feature. We trade the date format from one layout to another. built-IN integrated – we’ve saved date integrated MM-DD-YYYY format integrated a variable, and we need to change it to DD-MM-YYYY format.
we will gabuiltintegrated this conversion built-in built-in the use of strtotime() and date() function. The strtotime() first converts the date integratedto the seconds, and then date() function is used to reconstruct the date integrated any layout. beneath a few examples are given to transform the date layout.
change YYYY-MM-DD to DD-MM-YYYY
integrated beneath built integrated, we’ve date 2019-09-15 built-in YYYY-MM-DD format, and we are able to convert this to 15-09-2019 integrated DD-MM-YYYY layout.

Output
New date layout is: 15-09-2019 (DD-MM-YYYY)
change YYYY-MM-DD to MM-DD-YYYY
built-in the under example, we’ve date 2019-02-26 built-in YYYY-MM-DD layout, and we are able to convert this to 02-26-2019 (MM-DD-YYYY) format.

Output
New date format is: 02-26-2019 (MM-DD-YYYY)
alternate DD-MM-YYYY to YYYY-MM-DD
built-inside the integrated below built-in, we’ve got date 17-07-2012 integrated DD-MM-YYYY layout, and we will convert this to 2012-07-17 (YYYY-MM-DD) format.

Output
New date format is: 2012-07-17 (YYYY-MM-DD)

convert date time into D-M-Y Format

$date=date_create($created_on );
$bdate=date_format($date,”dS M, Y”);

in above example $created_on store your date time value and covert them into D-M-Y format

Output

14th Dec, 2015

MilesWeb Review: Shared Hosting To Launch Your Business Online

Pricing is an important feature when it comes to choosing a web host. With this, reliability, performance, and features of web hosting are some of the factors that you need to consider.

So, it is necessary to do some research before choosing a web hosting provider. And this is why I have done the research and come up with the best & web hosting provider in the market, MilesWeb.

MilesWeb is one of the popular website hosting companies. They are known for offering the best & cheap web hosting services to customers globally.

In this blog, I will share a review of their shared hosting. Shared hosting is undoubtedly the most economical option for most business owners. MilesWeb’s cheap shared hosting plans sounds too good, where you can go online by subscribing to their plan for just Rs.40 per month.

Let’s Know About Shared Hosting

In shared hosting, server space is shared among multiple users, which means numerous websites are hosted on a single server. You get all the tools and resources which are required to create and manage your website. Shared hosting is ideal for beginners who want to get online by investing less.

Undoubtedly when the traffic increases on your website, you can opt for other hosting options like VPS or dedicated server hosting.

MilesWeb Shared Hosting Pricing & Plans

MilesWeb has kept three plans for shared hosting, Solo, Prime, and Multi.

The entry-level plan is Solo which starts at Rs.60 per month on subscription for three years. The Solo plan is ideal for beginners and personal websites. With the Solo plan, you get to host one website. MilesWeb also offers 10 email accounts, unlimited bandwidth, website builder, free SSL certificate, 1GB SSD disk space, control panel, one-click installer, WordPress optimized and 3 MySQL databases.

The next is Prime which costs Rs.195 per month on the subscription of three years. The Prime plan is best for small and medium-sized businesses. With Prime plan, you are allowed to host one website. The other resources included are one free .com domain, unlimited email accounts, unlimited SSD disk space, unlimited bandwidth, free SSL certificate, website builder, control panel, one-click installer, WordPress optimized, and unlimited MySQL databases.

The high-tier plan is Multi that costs Rs.255 per month on a subscription of three years. With the Multi plan, you are allowed to host unlimited websites. It also includes unlimited email accounts, unlimited SSD disk space, unlimited bandwidth, free SSL certificate, website builder, control panel, one-click installer, WordPress optimized, and unlimited MySQL databases.

MilesWeb Shared Hosting Features

Below are some of the noteworthy features of MilesWeb’s shared hosting.

Free SSL Certificate

You don’t have to worry about the security of your website, because MilesWeb offers an SSL certificate with all the web hosting plans. An SSL certificate on your website builds trust for anyone who is visiting your website. It also helps in increasing the Search Engine Rankings of your website. Thus, with MilesWeb, you get a Let’s Encrypt at no extra cost.

One-Click Installer

It’s easy to install popular Content Management System applications such as Joomla, WordPress, Magento and 400 plus applications with only one click. MilesWeb gives you a Softaculous installer through which you can install these popular applications.

SSD Storage

If you don’t want to compromise on the speed of your website, SSD storage drives are what you need. With MilesWeb websites are saved on SSD drives which deliver more agile performance to your website. The SSD drives are excellent and most advanced storage units. Your site performs better when stored on super-fast SSD drives.

Free Website Builder

Building your free website is easy with the website builder tool, which you get with MilesWeb. It lets you create your free website with just two simple steps. Firstly, you need to select templates, drag and drop the content and images and, you are ready to publish your website online.

Datacenter Location

It’s paramount that you select a data center wisely. The location of the data center affects the data delivery speed of websites. MilesWeb has its data centers in several locations including, India, the United Kingdom, the United States of America, Singapore, Australia, and Canada. They give you the freedom to choose the data center location according to your preferred audience.

The Best Features of MilesWeb’s Hosting

99.95% Uptime Guarantee

MilesWeb promises a 99.95% uptime guarantee, which is an industry standard. They make sure your site is running round the clock and delivers a great hosting experience to users.

30 Days Money Back Guarantee

In case if you are not happy with their services, you can opt for a refund within 30 days. They will give a full refund of your money within 30 days of signing up for their web hosting plan.

Conclusion

MilesWeb offers the best-shared hosting service at an affordable price. With all the shared hosting plans, you get 24/7 expert support, a 99.95% uptime guarantee, data center choice, and all the best features to launch your first website online.

MilesWeb Review: Fast & Scalable VPS Hosting

MilesWeb Review: Fast & Scalable VPS Hosting

MilesWeb is another leading name in the market of hosting providers in India. They offer the best and quality services at an affordable price.

When looking for an affordable option to host a website, we opt for the basic shared hosting service. And why not? Shared hosting services are cheap and provide you a good enough features.

However, as your website grows, you will find that it will require more resources and functionalities. It is the right time when you need to look for VPS hosting. VPS hosting is a step up from shared hosting as it offers more speed, power, and advanced features for your high-traffic or growing website.

If you go through this MilesWeb review, then you will come to know the best thing about their managed VPS hosting.

Let us start by knowing MilesWeb as a company, and then we will move forward to know about their best Linux VPS hosting India in detail.

Know About MilesWeb

MilesWeb is an Indian-based web hosting provider. Their services include shared hosting,  reseller hosting, WordPress hosting, cloud hosting, cheap windows VPS hosting, and dedicated server hosting.

MilesWeb is an award-winning web hosting provider recognized for offering web hosting solutions to individuals, small and medium-sized businesses. To put it in simpler words, it aims at meeting the needs of business owners with its varied web hosting services.

VPS Hosting

A VPS, also known as a Virtual Private Server, is becoming the most popular solution for many businesses. VPS hosting gives you more control and security as compared to shared hosting over an isolated environment. VPS hosting shares the physical server with few others but assigns dedicated resources to each user.

Benefits of VPS hosting

  • One of the most important benefits you get in VPS hosting is the amount of bandwidth and space.
  • It is necessary if your website generates a high amount of traffic or if you expect extensive growth shortly.
  • With VPS hosting, you get complete power and all the advanced resources for the optimal performance of your website. You also get ultimate reliability and stability that helps to reduce downtime issues.
  • In terms of cost, VPS hosting falls between shared and dedicated hosting.

Fully Managed VPS Hosting of MilesWeb

With the fully managed VPS hosting, the in-house expert team of MilesWeb will monitor your complete VPS. Also, they take complete care With the fully managed VPS hosting, the in-house expert team of MilesWeb will monitor your complete VPS. Also, they take complete care of server management so that you can focus on growing your business. You don’t have to pay any additional cost for VPS management. The VPS plans are the best options for those who want to upgrade from a shared platform to a VPS and do not have any prior technical skills or system administration knowledge.

MilesWeb’s VPS Hosting Plans and Pricing

MilesWeb has a different range of VPS hosting plans to choose from. They have managed VPS hosting plans divided into Standard and Memory Optimized.

The Standard VPS hosting plan comprises ten plans and, the Memory Optimized VPS server hosting plan comprises eight packages.

Standard VPS Hosting Plans

Memory-Optimized

To know about the resources and the pricing of each VPS hosting plan, refer to the above image.

Features of MilesWeb’s VPS Hosting

Instant Provisioning

For customers that subscribe to VPS hosting, MilesWeb promises and delivers instant provisioning of their services. It is the best thing for people who want to skip the lengthy verification process. After confirmation of your payment, your hosting account is set up and, your website will be live instantly.

SSD VPS Servers

When you opt for MilesWeb’s VPS hosting, you get to host websites on the servers with built-in 100% SSD drives. They use SSD technology with all servers to ensure that you get high-performing VPS hosting. The SSD VPS servers act as a reliable web hosting platform for your websites/applications.

Control Panel Installation and Configuration

You don’t have to worry about the control panel installation and configuration. You need to simply choose the control panel from DirectAdmin or cPanel, WHM, and decide which VPS hosting plan you want to opt for. Their support team will install and configure the control panel for you.  

Customer Support

MilesWeb offers multiple customer support channels like live chat, email, and ticket support. If you require any instant help, their support team is available 24/7 to help you resolve issues related to web hosting. 

Uptime Guarantee 99.99%

MilesWeb offers a 99.99% uptime guarantee for its VPS hosting service. A very high uptime guarantee in the industry! They make sure that your site will be available almost always. With their Tier-3 and Tier-4 data centers, you get the best uptime for your high-traffic websites.

Conclusion

MilesWeb offers the best VPS server hosting for your resource-heavy website/application. With all the VPS hosting plans, you get top-notch features like a 99.99% uptime guarantee, SSD-based VPS servers, and 24/7 best customer support. Compared to other website hosting providers in the market, MilesWeb Serves the best VPS hosting services at affordable prices.

MilesWeb Review: #1 Reasons To Consider Their Managed Dedicated Hosting

MilesWeb Review: #1 Reasons To Consider Their Managed Dedicated Hosting

How long have you been in the business?

One year? 2 years or probably more, right?

I don’t know which hosting service you are using. But, if you have been doing business for a long time and have seen consistent growth, I would suggest you go for a dedicated server.

Why? The chances of your business growth getting stuck are high. VPS hosting is a good deal when you require personal resources like RAM and CPU. But, with time, you also need a dedicated server that is committed to only your website.

You must have noticed many websites having downtime during occasions, big sales, and sudden heavy traffic. The reason for the same is simple. The web server of those websites doesn’t have enough capacity to manage heavy traffic, so it fails to respond.

If you wouldn’t want to experience anything as such, a dedicated server is a must.

Additionally, with growth, your work and other stuff would increase too. With increasing responsibility, you may not have time to look after your dedicated server.

You may even lack technical skills. You might not be familiar with certain technical concepts, and experiments can lead to bad experiences. In that case, you can also opt for managed dedicated server India hosting.

What Does a Dedicated Server Mean?

A dedicated server is a committed server provided by the web host to the user. The dedicated server offers you an isolated environment where there is no other user sharing the server with you.

You enjoy full control over your server and resources such as RAM and CPU. The number of resources you get is comparatively higher than VPS, which is the best part of a dedicated server.

Dedicated service, in other words, help you manage more traffic. It gives your website the strength to hold the load.

Where can I get Dedicated Hosting?

MilesWeb is the top selection for dedicated hosting and Linux reseller web hosting. They have the most affordable hosting plans and are leading among other web hosting providers.

Over time, the web host has served clients globally and is also one of the best hosting providers in the US.

You will not find low-cost dedicated plans anywhere, as the dedicated server is always expensive. But, MilesWeb makes it affordable for its users.

Not only affordable but they also aim at providing quality services. So, you don’t need to worry about low-quality for a cheap price. 

How much does MilesWeb Charge?

MilesWeb dedicated hosting plans range from Rs. 6999/m to Rs. 46,999/m. The lowest plan consists of 8 GB Memory, 1TB Storage, and 1TB Bandwidth. As per plans, they are expandable.

What Powerful Features do They Provide?

Superior Performance – MilesWeb dedicated servers come with guaranteed high performance. That means other websites’ traffic is nowhere near to impact your traffic. So, you will experience high performance for your website/apps.

SSL Certificate – You get an SSL certificate with all MilesWeb’s dedicated hosting plans. An SSL certificate encrypts important data shared to and from your web server. It puts a security layer on your website and makes it more authentic for users. Visitors will rely on your website with their information and will feel safe.

Service Level Agreement 99.99% – MilesWeb guarantees 99.99% uptime being the highest among other hosting providers. Due to 99.99% uptime, your website will always be running effortlessly. You will not have to face unnecessary downtimes.

Host Unlimited Websites – You can host unlimited websites by purchasing a dedicated hosting server. You have a plus point if you are a developer or designer. You can resell your resources and host your clients’ websites on your server. You will have an extra side hustle, which is not a bad idea.

You can also move all your websites from other servers like VPS to the dedicated server.

Customization – You can customize your bare metal server as you like. Install heavy web applications, and it will still work smoothly. MilesWeb allows complete SSH root access so you can control the server as you want.

Reliability – If you measure the reliability of MilesWeb’s dedicated server, it is the highest. As you don’t share the server and resources with others, the resources are highly reliable to your website.

High Privacy – MilesWeb dedicated servers ensure high security. Because there is no other user’s traffic impacting yours, a high level of privacy is maintained.

Security is important when it comes to brand identity. For any user, safety is the primary factor. So, to keep their information safe and secure, dedicated servers come with the utmost privacy.

Milesweb also offers 1 dedicated IP with all dedicated plans, where you get a unique IP address.

Control Panel – You can select your control panel. MilesWeb provides the best control panels like Plesk, cPanel and Webuzo, which will help you manage your server with ease.

Wrap Up

A dedicated server stores your web contents on a server exclusively leased by you. It allows easy customization and a higher level of security. Although it is expensive, MilesWeb offers it at affordable rates.

You will have a complete server to yourself and no need of sharing it with others.

Although many hosting providers offer dedicated hosting, I doubt there are any like MilesWeb.

Get all days and dates for the selected month of a year using php

Try this code for following purpose

  1. Get all days and dates for the selected month of a year using php
  2. How to get full day name from date in php
  3. Get day name from date in PHP

Just Follow below step and you will Get day name from date in PHP or print all dates, days of current month

### Step1: 
 
<?php
date_default_timezone_set('Asia/Kolkata');
$month = date('m');
$year = date('Y');
$cur_date = date('Y-m-d');

$d = $day_count =cal_days_in_month(CAL_GREGORIAN,$month,$year);


$cdate=date('d');

?>

### Step2:

    <?php
        $day = 1;
        while($d){             
            ?>

                    <p>
                        <?php 

                        if($day=="$cdate") {
                            echo "<b>".$dated = ($day++.' '.(date("M Y")))."</b>";
                        } 
                        else 
                        {
                            echo $dated = ($day++.' '.(date("M Y"))); 
                        }
                        echo '('.$day_name = date('D', strtotime($dated)).')';

                        ?>
                            
                    </p>
                        
    <?php  $d--; } ?> 

How to show only 50 words using PHP

Try this code for following Pupose

  1. Php show only first 50 characters
  2. how to show only 50 words using php
  3. Php limit string to 50 words
  4. Display limited text in PHP
  5. Get first 50 characters string php

you can adjust number of character i mean if you need to show only 20 character then need to change 50 to 20

Here are two method which one you understand just use them in your code

<?php

$in=”Pellentesque habitant morbi tristique senectus eter netus et malesuada fames ac turpis egestas. Morbi purus nisl, blandit et eros id, pharetra tristique massa. Nulla facilisi. Curabitur lobortis urna eu neque congue, id cursus purus placerat. In malesuada est tellus. Nunc ac ullamcorper nibh. Maecenas lacus dolor, volutpat sed augue sit amet, maximus condimentum sem. Aenean nec egestas orci. Sed fringilla augue eget arcu consectetur interdum. Praesent sed dignissim risus. Ut lobortis dolor nec sagittis dapibus. Donec eget dolor vitae elit porta commodo in et magna. Nunc sapien nisl, euismod ac ex vitae, sodales feugiat lorem. Phasellus condimentum, nulla cursus porta mollis, nulla urna dapibus velit, vitae sagittis arcu risus vitae orci. Praesent leo nisi, laoreet id mauris nec, hendrerit feugiat lacus. Praesent vulputate lorem vel lobortis aliquam.”;

?>

Method:1

<?= $out = strlen($in) > 50 ? substr($in,0,50)."..." : $in;?>

Method:2
$result = substr($in, 0, 50); //first 50 chars “Pellentesque habitant morbi tristique senectus eter”

How to show/hide an element on checkbox checked/unchecked states using jQuery?

Just use below code for following purpose

  1. How to show/hide an element on checkbox checked/unchecked states using jQuery?
  2. jquery show-hide div based on checkbox value
  3. If checkbox is checked show div
  4. on checkbox checked show div jquery
  5. How to show and hide input fields based on checkbox selection
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>How to show/hide an element on checkbox checked/unchecked states using jQuery?</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
 <script>

function myFunction() {
  var checkBox = document.getElementById("cwebsite");
 
  var text = document.getElementById("cwimg");
  
  if (checkBox.checked == true){
    text.style.display = "block";
  } else {
     text.style.display = "none";
  }
}

 </script>
</head>
<body>
    <form>
        <h3>Select your favorite sports:</h3>
        <input type="checkbox" value="1"  onclick="myFunction()" id="cwebsite" class="form-control" name="cwebsite" >
        <img src="" id="cwimg">
    </form>
</body>
</html>
how to get checked checkbox value using jquery

how to get checked checkbox value using jquery

You can use the jQuery :checked selector together with the each() method to retrieve the values of all checkboxes selected during a group. The each() method used here simply iterates over all the checkboxes that are checked. Let’s try an example to check how it works:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>how to get checked checkbox value using jquery</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
    $(document).ready(function() {
        $("button").click(function(){
            var favorite = [];
            $.each($("input[name='sport']:checked"), function(){
                favorite.push($(this).val());
            });
            alert("My favourite sports are: " + favorite.join(", "));
        });
    });
</script>
</head>
<body>
    <form>
        <h3>Select your favorite sports:</h3>
        <label><input type="checkbox" value="football" name="sport"> Football</label>
        <label><input type="checkbox" value="baseball" name="sport"> Baseball</label>
        <label><input type="checkbox" value="cricket" name="sport"> Cricket</label>
        <label><input type="checkbox" value="boxing" name="sport"> Boxing</label>
        <label><input type="checkbox" value="racing" name="sport"> Racing</label>
        <label><input type="checkbox" value="swimming" name="sport"> Swimming</label>
        <br>
        <button type="button">Submit</button>
    </form>
</body>
</html>
Secured By miniOrange