Generate Random String Number in PHP JavaScript Ruby Python

Generating Random String Using PHP, JavaScript, Ruby, Python

Sometime in the programming world, you may need to generate a random string for any purpose, just like to random password suggestions, random passwords for your users. Today, In this Article we will study how can we achieve that in the easiest and fastest way. Random password / Random String can be generated with fully-custom functions but when we compare that with custom function those uses pre-defined functions of that language then that will be the best and fastest. As pre-defined function’s definitions are already compiled where the fully-custom functions are not compiled. Compiler/Interpreter will compile the code (fully-custom function) before executing that. And that will take a couple of microseconds to make it executable. But when it comes with …

Read More
Install Open SSL Windows10 Localhost

How to Install OpenSSL Light on Windows 10

What is OpenSSL? OpenSSL is a general purpose cryptography library that provides an open source implementation of the Secure Sockets Layer (SSL) and Transport Layer Security (TLS) cryptographic protocols. It is a robust, commercial-grade, and full-featured toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) cryptographic protocols. So to install SSL or to make SSL/https working on any server/system you have to install OpenSSL. Therefore we will show you how you can install OpenSSL on your Windows 10 so that you can run SSL/https on your localhost system. Download OpenSSL Setup for Windows 10 Click here and download appropriate OpenSSL as per your windows 10 (32-bit / 64-bit). Install OpenSSL After successfully download please follow the steps to …

Read More
Setup SSL On Localhost

How to add SSL/HTTPS to localhost WAMP Server

Install OpenSSL Download appropriate OpenSSL as per your windows bit (32-bit / 64-bit) from http://slproweb.com/products/Win32OpenSSL.html and install. While installing the setup it will ask you to select a directory for installation. You can install in any drive. So I am installing in my ‘E’ drive. You can read our article How to Install OpenSSL Light on Windows 10. And after install its path is E:\OpenSSL-Win64 Generate self-signed key and certificates for localhost Open E:\wamp64\bin\apache\apache2.4.33\conf\ folder and create a folder ‘ssl-certs’. Now, in cmd (Command Prompt) navigate to E:\wamp64\bin\apache\apache2.4.33\conf\ssl-certs directory and run following command. You can change the value for -days to the expiry days. I am creating certificates for the very long-term 😀

After certificates & key successfully created you should match …

Read More
Laravel

Laravel 5.7 HTTP URL Redirects

Today in this article we will discuss the HTTP URL Redirection in Laravel 5.7.  Laravel HTTP Redirect is an instance of Illuminate\Http\RedirectResponse class, which contains all necessary headers that needed to redirect the user to specific URL. Laravel provides many ways to generate RedirectResponse instance. redirect helper is the simplest way to redirect user to another URL. redirect helper is a global helper method. Redirect To URL in Laravel This is the simplest way to redirect the user to a particular URL.

Note: In the above example, If user hits the /dashboard URL then we are redirecting that user to new URL and that is /home/dashboard. Redirect Back To The Previous Page in Laravel Laravel is a very powerful PHP framework …

Read More
Laravel

Email Verification – New Feature of Laravel 5.7

Today, Laravel is a very powerful framework of PHP. Because of it’s vast available & scalable libraries/packages & developer’s full control on the project, It is now a new trend in PHP Web Development. On September 4th, 2018 Laravel has released it’s new edition i.e. Laravel 5.7 with some new features. Which make development more easy, fast and flexible. Laravel 5.7 Changes Log Laravel 5.7 continues the improvements made in Laravel 5.6 by introducing Laravel Nova. Optional email verification to the authentication scaffolding. Support for guest users in authorization gates and policies. Console testing improvements. Symfony dump-server integration. localizable notifications. Variety of ther bug fixes and usability improvements. Today, In this article we will discuss one of the new features of …

Read More
How To Fix Laravel SQLSTATE[42000]: Syntax Error Or Access Violation 1071 Specified key was too long

How To Fix Laravel SQLSTATE[42000]: Syntax Error Or Access Violation 1071 Specified key was too long

Today we will discuss the most common error of Laravel 5.4+ that is “Syntax Error Or Access Violation 1071 Specified key was too long”. Before moving ahead we should know the main root cause of this error. Laravel 5.4+ has made changes to the database’s default character set. Now, the updated character set is utf8mb4, which supports the emojis. Now, with this character set, you can store emojis in database table easily. If your web application/website is running on MySQL v7 or above then you do not need to do anything. Otherwise, you may face the following error while running the database migration command. Illuminate\Database\QueryException: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes …

Read More
Laravel

How to get last executed query in Laravel?

We have been much time need to get executed query log or you want to get last executed query or maybe if you want to display SQL query from Laravel query builder then you can do it that. so I have 2 examples for display executed query in Laravel 5.6. When you are working on Laravel application at that times, I think you need much time to print last run query or if you want to check direct from phpMyAdmin SQL box, so at that time you have to follow these 2 examples. So, let’s see 2 examples of getting SQL query from Laravel Query Builder. Example 1: In this example, we can get directly get current SQL query using …

Read More
Laravel

How to turn off CRSF protection for a specific routes in Laravel?

Laravel is a very powerful framework of PHP. It gives full control to developers to tackle any request. Laravel makes it easy to protect your application from cross-site request forgery (CSRF) attacks. Sometime in your project, you may need to disable the CRSF protection for particular routes/URLs. You can turn off CRSF protection by editing VerifyCsrfToken.php file.  In Laravel, open app/Http/Middleware/VerifyCsrfToken.php file and you can add specific URLs to $except array. The CSRF middleware is automatically disabled when running tests.

Source: https://laravel.com/docs/5.7/csrf

Read More
Coders Den

Best way to POST Form data, File via jQuery AJAX

In programming, you often required to POST form data via jQuery AJAX. Posting normal data via AJAX is the easiest task. But Posting an image, File through AJAX is quite tricky. Either you need to include plugin/library that does the same job or you need to do RD on this. But in some projects, you do not want to include those plugins/libraries. Here in this article, I will show you how you can POST your form data, image or FILE easily. Make this your habit in programming to call AJAX in this way and you will never face such problems. You will get your all data (normal data, image, FILES) on server side language. HTML File / Form

Javascript …

Read More

How to fix cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

Today I setup SSL/https for my localhost on my windows 10 & WAMP Server 3.1.3. Everything is working fine but when I ran my curl code it throws following error. cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) And, after Google, I found the solution. So here I am writing this article so that if anyone faces the same issue so he/she can easily solve the issue. Download the latest curl recognized certificates here: https://curl.haxx.se/ca/cacert.pem Save the cacert.pem file in a reachable destination. Then, in your php.ini file, scroll down to where you find [curl]. You should see the curl.catinfo option commented out. Uncomment by removing ; from the front of this. And point …

Read More