How to do Real time form arithmetic in JavaScript

How to do Real time form arithmetic in JavaScript

This snippet can be used to do Real time arithmetic using JavaScript. In the example below. I am using a simple arithmetic to calculate 4% tax and output real-time total amount. Create an HTML form field for input amount. Create two input fields to output tax and total sum in Real time. </p> <p><input id=”amount” type=”text” onKeyPress=”OgKeyPress()” onKeyUp=”OgKeyPress()”><br><br /> <input id=”tax” type=”text” disabled><br><br /> <input id=”totalamount” type=”text” disabled><br /> 0 1 2 3 4 <input id=“amount” type=“text” onKeyPress=“OgKeyPress()” onKeyUp=“OgKeyPress()”><br> <input id=“tax” type=“text” disabled><br> <input id=“totalamount” type=“text” disabled> 2. Following JavaScript…

Read More

How to fix: There are no HTTP transports available which can complete the requested request

How to fix: There are no HTTP transports available which can complete the requested request

This error message pops up while updating WordPress Core, Themes or Plugins. This error is common on localhost installations.Here is how it looks: How to fix The error pops up when Curl extension of PHP and OpenSSL are not enabled. To fix this issue you need to enable curl and openSSL. Search for php.in PHP configuration file in Apache directory of your LAMP or WAMP package or other custom installations. Look for this line. </p><br /> <p>;extension=php_curl.dll<br /><br /> 0 1 2 ;extension=php_curl.dll If there is a semi-colon at start…

Read More

How to make menu links open in a new tab/window

How to make menu links open in a new tab/window

By default a menu link in WordPress Menus opens in same window.What if you want a page ,category or other post type link in a menus open is new window/tab ? It is very easy to set a hyperlink to open in new tab/window in HTML. </p> <p><a href=”http://wpgyan.com” target=”_blank”>Link Text</a><br /> 0 1 2 <a href=“http://wpgyan.com” target=“_blank”>Link Text</a> In WordPress by applying some conditional PHP codes in menu it can be set to open to new window/tab. But In this post I am going to show you how to…

Read More

How to redirect to another page in WordPress

How to redirect to another page in WordPress

A page can be redirected to a new page or URL. There are different methods to achieve this. In this blog post we will deal with all these methods in details. Use of these methods depends upon different  use cases. Sometimes HTML redirect work perfectly, in some cases JavaScript or PHP. There is a WordPress function which can also be used and I think it is best to use WordPress function. Here are different methods for redirect   HTML Method In this method we will use meta redirect. Add following…

Read More

How to reset WordPress password at Localhost

How to reset WordPress password at Localhost

In this article I will explain steps to  Recover WordPress Admin password at localhost via phpMyAdmin Interface. Resetting password at live server of WordPress Self hosted blogs/websites are easy. What if you forget password of a localhost installation? To reset password at localhost some manual work needed to be done.  On localhost installations WordPress Reset password function don’t send a reset e-mail to your e-mail.Since most default localhost server install has not configured to send a e-mail.   So, How to deal with it? Follow these steps to recover Lost…

Read More

How to resolve: Please register your email IDs used in non-smtp mails through cpanel plugin…

How to resolve:  Please register your email IDs used in non-smtp mails through cpanel plugin…

In recent Cpanel update an Error Message is flashing: Attention! Please register your email IDs used in non-smtp mails through cpanel plugin. Unregistered email IDs will not be allowed in non-smtp emails sent through scripts. Go to Mail section and find “Registered Mail IDs” plugin in paper_lantern theme. What is the issue? Due to issue,  Your PHP forms, mailing scripts will stop working and mail will not delivered in mailbox. For example….. In contact form plugins If we leave the ‘From’ field blank, WordPress automatically sets the ‘From’ as wordpress@yourdomain.com. Same…

Read More

How to run multiple commands in Linux SSH

How to run multiple commands in Linux SSH

To run multiple commands in Linux SSH, all we need a to write a Bash shell script. The shell script execute the commands based on the order in which commands have been written. You can have loops, if else statements etc like any other programming.  For this post I am restricting myself to getting started with a shell script and run few commands. Here are steps to create a simple Bash shell script. Create an empty file using vim. </p> <p>vim test.sh<br /> 0 1 2 vim test.sh Enter Bash…

Read More

How to send mail via SMTP on WordPress sites

How to send mail via SMTP on WordPress sites

Email delivery  is an issue faced by almost every WordPress site these days. Mail services like Gmail, Yahoo etc have tightened the spam filtering mechanism to filter spam. In this post I will explain and go through steps to set SMTP to send mail via a WordPress plugin. It will greatly help in delivery of email in mail boxes. What is SMTP? SMTP is a standard or protocol to send and receive emails. SMTP stands for Simple Mail Transfer Protocol. Send Mail via SMTP There are many plugins in WordPress…

Read More

How to solve Error establishing a database connection in WordPress

How to solve Error establishing a database connection in WordPress

The error “Error establishing a database connection” is very common in WordPress. It literally means there is an issue connecting to database server. This issue may be caused either by wrong info in WordPress code files or Database server is unable to respond to queries sent to them.   Let’s look at all possible reasons one by one. Wrong database server info in wp-config.php file Make a backup of wp-config.php file and look for following details and make sure they are correct. Database name Database username Database password Database hostname As…

Read More

Resolve Warning: htmlspecialchars(): charset `UTF-7′ not supported, assuming utf-8

Resolve Warning: htmlspecialchars(): charset `UTF-7′ not supported, assuming utf-8

I  recently got this warning message on one of WordPress site I am admin at. This error occurred after updating  the WP site to latest version. </p><br /> <p>Warning: htmlspecialchars(): charset UTF-7′ not supported, assuming utf-8 in /home/bookis/public_html/wp-includes/formatting.php on line 3058<br /><br /> 0 1 2 Warning: htmlspecialchars(): charset UTF–7‘ not supported, assuming utf–8 in /home/bookis/public_html/wp–includes/formatting.php on line 3058   Problem htmlspecialchars() is a PHP String function which converts special characters to HTML entities.So once a special character encounters it converts it to a HTML entities. for example: ‘&’ (ampersand)…

Read More