20 Complete scripts to download

PHP, PHP Scripts, Techniques, Tips, Web Design & Programming
I've assembled a superb small accumulation of scripts over the previous year or thereabouts, and have chosen as its approaching summer in the Uk (sorry winter in Australia!) to do a download heap of 20 different scripts where you can get the parcel in a single click gratis! In spite of the fact that gifts are likewise highly acknowledged. Look at the record underneath for all the portions of the bundle. This accumulation is dependent upon a mixture of diverse systems, from Css, Php jquery to Mysql. jQuery Drag & Drop Using jQuery PHP and MySQL a complete drag and drop script that updates the database. jQuery Delete Delete items using PHP jQuery using an AJAX request. PHP jQuery and MySQL Autosuggest A powerful autosuggest script that searches a MySQL…
Read More

Country drop down list with php function

Databases, PHP, PHP Scripts, Tutorials
I had a venture as of late that needed the client to select their nation from a drop down record and store the information in a database. It was such a long process setting up the Php switch proclamation that I supposed somebody may find it handy for an activity. The code underneath is a depiction of the switch proclamation I've setup. The download at the lowest part incorporates 238 nations and mainlands. You recently need to store the nation code in the database then call the capacity beneath to furnish a proportional payback name. Download full code from here
Read More

Google’s Weather API in PHP

PHP, PHP Scripts, Web Design & Programming
It might be a delightful small task to compose an excercise on the most proficient method to construct an essential yet capable climate provision for either portable units or the desktop. The requisition takes a set of Google climate Api encourages and settles on some straightforward choices dependent upon the yield. For instance we can propose the client takes an umbrella if downpour or storms are gauge, or if the temperature warrants the requirement for warm apparel. Essential however in any case suitable informative data. Code Lets have a snappy go through at what the undertaking comprises of. Firstly we utilize the simplexml_load_file() Php capacity to get the xml information for the given area. We then verify whether the present climate condition is in the Xml record. Provided that it…
Read More

Create an error page to handle all errors with PHP

PHP, PHP Scripts, Tutorials
Here's an exceptionally modest result for taking care of a mixed bag of Http mistakes like 404, 500.. and so on in one php index. All we have to do is make a cluster of lapse codes and match against them by getting the worldwide redirect status code utilizing Php. This implies that we can utilize one page the handle various blunders. The Code You'll have to overhaul your .htaccess document so when a mistake is recognized the server knows how to handle the solicitation. For our situation we're set to send all the recorded slips to our nonexclusive errors.php record. ErrorDocument 400 /errors.php ErrorDocument 403 /errors.php ErrorDocument 404 /errors.php ErrorDocument 405 /errors.php ErrorDocument 408 /errors.php ErrorDocument 500 /errors.php ErrorDocument 502 /errors.php ErrorDocument 504 /errors.php The PHP This is the…
Read More

Display Facebook likes / Shares PHP function

PHP, PHP Scripts, Techniques
The CodeBelow is a super simple function that retrieves a JSON feed of comments, likes and shares for any URL you provide. function facebook_shares($url){ $fql = "SELECT url, normalized_url, share_count, like_count, comment_count, "; $fql .= "total_count, commentsbox_count, comments_fbid, click_count FROM "; $fql .= "link_stat WHERE url = '".$url."'"; $apifql="https://api.facebook.com/method/fql.query?format=json&query=".urlencode($fql); $fb_json=file_get_contents($apifql); return json_decode($fb_json); } How to use $fb = facebook_shares('https://www.facebook.com/redbull'); // facebook share count echo $fb[0]->share_count; // facebook like count echo $fb[0]->like_count; // facebook comment count echo $fb[0]->comment_count;
Read More

Show Google Plus’s – PHP function

PHP, PHP Scripts, Techniques
To get prefers and impart information for a Url here's a capacity to get Google Plus' for any Url. The Code It’s worth pointing out you must have CURL enabled on your web server, I believe it’s enabled by default on PHP5 setups. Also the Key below Isn’t a unique API key you must leave the key as is to ensure the code works properly. function gplus_shares($url){ // G+ DATA $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://clients6.google.com/rpc?key=AIzaSyCKSbrvQasunBoV16zDH9R33D88CeLr9gQ"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_POSTFIELDS, '[{"method":"pos.plusones.get","id":"p", "params":{"nolog":true,"id":"' . $url . '","source":"widget","userId":"@viewer","groupId":"@self"}, "jsonrpc":"2.0","key":"p","apiVersion":"v1"}]'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json')); $result = curl_exec ($ch); curl_close ($ch); return json_decode($result, true); } Example Usage $gplus = gplus_shares('https://facebook.com'); echo $gplus[0]['result']['metadata']['globalCounts']['count'];
Read More

Simple MySQL database access wrapper

Databases, PHP, Tutorials
This class is a basic Mysql database access wrapper. It can: -Establish an association with a given Mysql server host -Execute Sql questions -Retrieve question comes about into exhibits -Retrieve the outcome set number of columns, final embedded identifier or the amount of influenced columns -Check if a database table record exists matching a given condition -Retrieve the amount of records that a table has matching a given condition Below is class: class.php: <?php class WGDB{ public $connection ; public $querycount = 0; public function db() {} public function connect($dbhost, $dbusername, $dbpassword) { $this->connection = mysql_connect($dbhost,$dbusername,$dbpassword); return $this->connection; } public function close() { return mysql_close( $this->connection ); } public function select_db($databasename) { return mysql_select_db($databasename,$this->connection); } public function exist($tablename, $fieldname, $value, $where = false) { $exist = $this->fastfetch("select * from `$tablename` where `$fieldname` = '$value' ".check($where, " $where").""); return check($exist['id'], true, false); } public function count($tablename, $where = false) { $query = $this->query("select * from `$tablename` ".check($where, "where $where").""); return $this->fetchnum($query); } public function query($sql) { $this->querycount++; return mysql_query($sql,$this->connection); } public function fastfetch($sqlcode, $type = MYSQL_BOTH ) { $query = $this->query($sqlcode) ; return $this->fetcharray($query, $type); } public function fetcharray($query, $type = MYSQL_BOTH ) { return mysql_fetch_array($query, $type); } public function fetchassoc($query) { return mysql_fetch_assoc($query); } public function fetchnum($query) { return mysql_num_rows($query); } public function fetchobject($query) { return mysql_fetch_object($query); } public function escape($string) { return mysql_escape_string($string);…
Read More

File browser with ajax

Ajax, PHP
This class can used to maintain indexes on the server side utilizing an Ajax based client interface to maintain a strategic distance from page reloading. It produce a client interface to perform numerous sorts of operations on server side records perusing envelopes, erase, duplicate, glue, cut, and make new index or envelope. Download file
Read More

Edit Table in Ajax

Ajax, PHP, PHP Scripts
This class might be utilized to alter information in the cells of a Html table utilizing Ajax to safeguard the adapted unit values without reloading the present page. It takes a bi-dimensional cluster as parameter to describe the substance of the units of the table to be altered. At that point it creates the table Html with the indispensible Javascript code to alter the unit substance. The client may alter the units by clicking on them. The unit is transformed into a content information so the client can modify the unit substance with the console. In the event that you are utilizing Advate then you can detail the sort of info you need returned: content, textarea, select, radio, and checkboxes. For the last three, you have the capacity to define…
Read More