Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 PHP


  Automatically post to Facebook from PHP script

Facebook is currently on of the most important publishing and traffic generating sources for many websites. Manually Cross publishing content on your own site and Facebook seems like a lot of extra work.This post guides you through the creation of a Facebook application that can automatically post messages and other types of content on your Facebook wall.Getting startedBuilding a php script that automatically posts status updates on your wall requires the following steps:Download Facebook APIRegister a Facebook appGive the app rights to post on your wallBuild the post to Facebook scriptGet the...

24,982 2       PHP FACEBOOK API OAUTH AUTO POST


  Why hasn't Facebook migrated away from PHP?

The reason Facebook hasn't migrated away from PHP is because it has incumbent inertia (it's what's there) and Facebook's engineers have managed to work around many of its flaws through a combination of patches at all levels of the stack and excellent internal discipline via code convention and style - the worst attributes of the language are avoided and coding style is rigidly enforced through a fairly tight culture of code review (failing to adhere to the style and "going cowboy" by writing sloppy code results in pitiless mockery by one's peers).  Engineering management has never had to ...

7,355 0       PHP FACEBOOK MIGRATION BAD FEATURE CODEBASE


  Node.js: Five Things Every PHP Developer Should Know

I recently started working on a few Node.js applications. Coming most recently from PHP (and Drupal in particular), I found the transition to Node.js to be surprisingly easy. Pleasurable, in fact. But I had to learn to think differently about a few things.Below I list the five things I think every PHP developer should know about Node.js.1. Node.js Is Built On Chrome's JavaScript EngineGoogle's browser, Chrome, has a notoriously fast JavaScript engine called V8. And this JavaScript engine can be cleanly separated from the web browser. Node.js is built on V8. This is one of the main reasons why ...

9,818 0       PHP DEVELOPER FEATURE NODE.JS


  Top 10 PHP Best Security Practices for Sys Admins

PHP is widely used for various of web development. However, misconfigured server-side scripting would create all sorts of problem. And here are php security best practices that you should aware when configuring PHP securely. Nowadays most of the web servers are operated under Linux environment (like: Ubuntu, Debian...etc). Hence, in the following article, I am going to use list top 10 ways to enhance PHP Security Best Practices under Linux environment.My sample setup for PHP Security Tips:DocumentRoot: /var/www/Default Web server: Apache Default PHP configuration file: /etc/php.iniDefaul...

4,878 0       PHP ADVICE CODE SECURITY SYSTEM ADMIN BEST PRACTICE


  10 super useful PHP snippets you probably haven’t seen

When working with PHP, it is very useful to have a “toolbox” of handy functions and code snippets that can save lots of time when needed. Today, I’m going to show you 10 super useful code snippets that you probably never heard of. Text messaging with PHP using the TextMagic APIIf for some reason, you need to send text messages to your clients cell phones, you should definitely have a look to TextMagic. They provide an easy API which allow you to send SMS to cell phones. Please note that the TextMagic service isn’t free.The example below shows how easy it is to ...

2,209 0       PHP CODE SNIPPET USEFUL CODE SEGMENT


  Supercolliding a PHP array

Did you know that inserting 2^16 = 65536 specially crafted values into a normal PHP array can take 30 seconds? Normally this would take only 0.01 seconds.This is the code to reproduce it:<?php echo '<pre>';$size = pow(2, 16); // 16 is just an example, could also be 15 or 17$startTime = microtime(true);$array = array();for ($key = 0, $maxKey = ($size - 1) * $size; $key <= $maxKey; $key += $size) { $array[$key] = 0;}$endTime = microtime(true);echo 'Inserting ', $size, ' evil elements took ', $endTime - $startTime, ' seconds', "\n";$startTime = microtime(true);$array = arra...

2,562 0       PHP ARRAY HASHTABLE SLOW COLLIDING


  Execute PHP from a .html File

How can I execute PHP code on my existing myfile.html page?:When a web page is accessed, the server checks the extension to know how to handle the page. Generally speaking if it sees a .htm or .html file, it sends it right to the browser because it doesn't have anything to process on the server. If it sees a .php extension (or .shtml, or .asp, etc), it knows that it needs to execute the appropriate code before passing it along to the browser. Here is the problem: You find the perfect script, and you want to run it on your site, but you need to included PHP on your page for it to work. You ...

6,840 0       PHP HTML PHP IN HTML ADDTYPE


  Using PHP sessions across subdomains

By default, PHP uses the 'PHPSESSID' cookie to propagate session data across multiple pages, and by default it uses the current top-level domain and subdomain in the cookie declaration.Example: www.domain.comThe downside to this is that the session data can't travel with you to other subdomains. So if you started a session on www.domain.com, the session data would become unavailable on forums.domain.com. The solution is to change the domain PHP uses when it sets the 'PHPSESSID' cookie.Assuming you have an init file that you include at the top of every PHP page, you can use the ini_set() functi...

26,540 0       PHP SESSION SUBDOMAIN AVAILABILITY