In my previous post, I introduced the sMention jQuery plugin – a plugin that adds the @mentions to a input element. But I haven’t told in the post how to handle the data on the server side after the form has been submitted. This handling replaces the @mentions to the user’s name in a[href] tag. It’s made possible using smention function bind as the callback function of preg_replace_callback. This smention function can be seen on the file comps/config.... [READ MORE]
Posts marked with "Posts" in posts
Fix WordPress Database Error "MySQL server has gone away.."
If you run a WordPress blog and see the error “MySQL server has gone away for query…..” on your error logs a lot, you are certainly in trouble. When this happens, your blog will be down. It happened to this blog and I started searching for a solution. Finally I got a solution and it works. It’s a simple solution. All you have to do is add 2 lines after a specific code.... [READ MORE]
Add @mentions To Input Fields – jQuery sMention Plugin
Mentioning persons using **@ **is pretty common on social web sites. Facebook, Google+ and even StackOverflow have the **@mention **feature. They developed it on their own and doesn’t share the code with others. If you are developing a social site, then it’s better to have this mention feature. I wanted this, but the jQuery plugins I found was too big. The first plugin I found was 20 KB ! This made me create a plugin of my own to accomplish my need.... [READ MORE]
Check If a Number is Odd Or Even In PHP & JavaScript
Odd numbers and even numbers are used in programming languages. To check if a number is even or odd needs brilliant code. In this post, you will be introduced to checkNum() function in both PHP and JavaScript. This functions will return even for even numbers and odd for odd numbers. Parameters $num – An integer (PHP) num – An integer (JS) Returns “odd” for odd number, “even” for even number.... [READ MORE]
E-Mail Verification Script In PHP Using Mailgun API
As years goes, so does the increase in SPAM on the web. Most users sign up on services with a fake E-Mail. They might even use other’s E-Mail for signing up. This is a big problem, because when you send an email to the signed up user, it goes to the wrong guy. So, you should verify user’s email before signing them up. You might think that it would cost database memory.... [READ MORE]
Create A Contact Form In PHP With Mailgun
Contact forms make it easy for the visitors of your site to contact you. Contact forms are available in various CM systems, but if you are creating your own site, you have to create the contact form yourself. The messages thus sent by the users have to be stored in databases and you have to constantly check the database for new messages. To overcome this problem, it’s better to directly send the messages to your inbox.... [READ MORE]
Encryption & Decryption Using Mcrypt In PHP
Mcrypt is a replacement of Unix‘s popular command crypt. It is a file encryption tool. Mcrypt uses modern algorithms for encrypting. Hence it is considered as secure and safe. To encrypt a string, Mcrypt requires a key to encrypt and decrypt. This key have a critical role in encryption and decryption. In this post I’ll be giving out two functions that will encrypt and decrypt based on a key. The Key We should use the same key for both encryption and decryption.... [READ MORE]
Send Free E-Mails Using Mailgun API in PHP
E-Mails increases your site’s traffic. E-Mails are used in websites that require E-Mail verification to Reset Passwords. There is already a mail function in PHP, but the E-Mails that are sent via PHP‘s mail function goes to SPAM folder in most of the mail services. So, developers use API services to send E-Mails that gets received on user’s Inbox. Most of the API‘s need money to use. If you are a starting developer, you need a Free service.... [READ MORE]
Check If jQuery is Loaded Using typeof Operator in JavaScript
jQuery is the most used and popular library of JavaScript. If jQuery isn’t loaded, a jQuery coded site will not function properly. Such sites will reload automatically or give an error when jQuery isn’t loaded. But, how do they check if jQuery is loaded ? You will find a simple solution to accomplish this task in this post. Since, jQuery won’t be loaded, we can’t check if jQuery is loaded using jQuery.... [READ MORE]
Use uTorrent Without Installing (Portable uTorrent)
Torrents are the most common thing computer users hear of. There are torrent downloading, torrent sharing and many others. Torrent has become a business in the WWW. Due to the increase in demand of torrents, there should be torrent clients that downloads the files of a torrent. The most popular of them is uTorrent – A Windows package. uTorrent is widely used by computer enthusiasts. uTorrent is widely used because of it’s lightness, simple usage and limitless options.... [READ MORE]