I recently noticed a Google Chrome Webstore app that can be used for making a request to a web site or local site. I loved the app from the beginning. You can send a request to any site with header data, form data etc… You can also attach a file to the form. Ain’t that Awesome. Every web developer must have this app. Install it from Chrome Webstore Features – Integrated with Google Drive – It’s own backend service to store and share data between coworkers – convenient HTTP headers and payload editor thanks CodeMirror – Make a HTTP request (via XmlHttpRequest level 2) – Debug socket (via web socket API).... [READ MORE]
Posts marked with "Posts" in posts
Connecting database to both mysqli and mysql entension
You can use both mysql and mysqli extension for executing SQL queries. Here is a tutorial on how to connect both the extensions to a database. Create a file named config.php where you will connect to the database. Put the following code in it: $mysqli = new mysqli("localhost", "username", "password", "db"); if ($mysqli->connect_errno) { echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error; } $bd = mysql_connect("... [READ MORE]
Check whether mysqli connection is made or not in php
This function helps to check whether connection the mysql server has been made or not. Here is the code: if ($mysqli->ping()) { echo ("Our connection is ok!n"); } else { printf ("Error: %sn", $mysqli->error); } The $mysqli variable is a connection made via mysqli function. Know more about mysqli ping function here. ... [READ MORE]
Hide File Extensions In Browsers Using .htaccess
Many of us programmers want to hide the file extension of server files such as .php, .jsp, .py etc…. You can easily hide these extensions with the help of a .htaccess file. This feature is only available to Apache servers. Create a file named .htaccess if your root directory of site doesn’t have one. Add these lines to the .htaccess file : <span style="background-color: white; font-family: inherit;"><span class="kw1" style="border: 0px; color: #2060a0; line-height: 18.... [READ MORE]
Create Facebook Like System With jQuery, MySQL, PDO In PHP
Facebook have it’s own like system which pretty good. This post will tell you how to create a "Like system" like that of Facebook. All you have to need is jQuery, MySQL Database and PDO PHP extension. This technic is partially used in my social network, Open. See the demo there in the social network. But you have to signup. DEMO You should create a user table with users data including user id, username, password, email etc… <div> <span style="color: red; font-family: inherit;">The table should be like this:</span> </div> Let’s start by creating a likes table where we store the like actions by the user.... [READ MORE]
Friendshood Update new feature – Post to Facebook
I updated Friendshood. The new feature is that the user can post status update and photos to Facebook along with posting in Friendshood. I implemented this function using Facebook PHP SDK. You can download the SDK here. It was not quite easy. It was hard to make Picture uploading function along with the normal status update. Next I’m gonna implement twitter posting from Friendshood. I’m gonna tell you how to post a status update in the following posts.... [READ MORE]
How to get Facebook PHP SDK and install it
Download Facebook PHP SDK from here. Extract the folder src in the zip file to a folder named fbsdk in the home directory of your app. Installation There is no installation. You can run the functions in the file if you put this line at top of each file you run the SDK functions : include(‘fbsdk/facebook.php’); Facebook SDK requires the following to work properly : JSON PHP extension. CURL PHP extension. ... [READ MORE]
How to get Current Time and date in Javascript
This tutorial will help you to get current date and time at which the function is executed. Here is the function: function ctime(){ var currentdate = new Date(); var time=currentdate.getFullYear()+"-"+(currentdate.getMonth()+1)+"-"+currentdate.getDate()+" "+currentdate.getHours()+":"+currentdate.getMinutes()+":"+currentdate.getSeconds(); return time; } Just print out ctime() function to get the date and time in the format YEAR/MONTH/DAY HOUR:MINUTE:SECOND Explanation : new Date() function prints out the current date and time in a disorderly way. You can order it in any way as I did in the time() function.... [READ MORE]
The best age calculation code in PHP
Age calculation is a tricky calculation especially in Programming Languages. I’m going to tell you a simple way to find out age in PHP. This is a simple function that will calculate age if it is given a birthday date in the format date/month/year. For example : 20/01/2000 or 04/12/1990 Here is the function : function age($birthday){ list($day,$month,$year) = explode("/",$birthday); $year_diff = date("Y") – $year; $month_diff = date("m") – $month; $day_diff = date("... [READ MORE]
How to check if the mouse is over an element in jQuery?
Here is a simple plugin to check if the mouse is over an element in JQuery. Open your jQuery source file and search for window.jQuery = window.$ = jQuery; Paste the code shown below after the code you have just found. <span class="pln" style="border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"> $</span><span class="pun" style="border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;">.</span><span class="pln" style="border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;"... [READ MORE]