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

 ALL


  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,833 0       PHP DEVELOPER FEATURE NODE.JS


  10 Questions with Facebook Research Engineer – Andrei Alexandrescu

Today we caught up with Andrei Alexandrescu for a “10 Question” interview. He is a Romanian born research engineer at Facebook living in the US, you can contact him on his website erdani.com or @incomputable.We will talk about some of the juicy stuff that going on at Facebook, so let’s get started.Hello Andrei, welcome on Server-Side Magazine.1. Tell us a little bit about yourself. Who are you? Where and what do you work?Who am I? Ah, the coffee breath of one talking about himself. Well let me try. I’m a hacker living in the US, originally from Romania. In 2001 I wrot...

7,551 1       PHP C++ FACEBOOK FUTURE MACHINE LEARNING


  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,879 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,214 0       PHP CODE SNIPPET USEFUL CODE SEGMENT


  PHP to Objective C, where the f**k are parameters?

Javascript, PHP, Ruby functionsI assume you are very familiar with declaring functions in any of the languages above, if not, you should not be reading this. Let’s begin with a simple function to send email in these languages:// PHP or Javascriptdo_send_email (recipient, cc, subject, body);// Rubydo_send_email (recipient, cc, subject, body)So it’s clear by looking at the function’s signature that it takes 4 parameters and they could be optional, depends on your implementation. Even if you missed one parameter, in most cases it is fine, no complain, no fatal error.First enc...

3,846 0       PHP JAVASCRIPT PARAMETER OBJECTIVE-C FUNCTION NAME


  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,567 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,846 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,548 0       PHP SESSION SUBDOMAIN AVAILABILITY