Blogs

Posted by: Haig Kayserian

Google has created another way your web surfers can find your business, and it requires a few worthwhile minutes from you.

Google Places is another way interested individuals can pull up all important information about your business; including address, website, services provided, coupons, etc.

All you need to do is click here and enter your business data to get started.

Watch the video below to see the full potential.


Posted by: {authorName}

Here’s a big integration that I’m sure a lot of people will be excited about.

Skype 5.0 for Windows, which has just been released, has one of Skype's most significant ever enhancements. A Facebook tab.

This will bring your Facebook experience into Skype, meaning users can immediately SMS, chat or call their Facebook friends via Skype directly from their News Feed.
The Facebook News Feed option will display a list of activity nearly identical to what you would see if you were on Facebook, except below each status update there are two noticeable Skype buttons: SMS or Call.



The Skype 5.0 release also includes improved 10-way group video calling, much more enhanced contact lists, more emphasis on profiles, and a completely enhanced user experience.

With these changes, I am certain a lot more people would be excited to try Skype.

And this paves the way for Skype to become the primary connector between friends, family and social contacts.

Download Skype 5.0 by clicking here.

Posted by: {authorName}

For different reasons, I encounter this problem every year and kept forgetting how to solve this. So I thought I would write this solution as a blog so I always remember. :)

First of all, the answer to the question is you cannot. Why?

Because $_GET and $_POST (and a few others) are HTTP variables. Meaning they can only be accessed if you are running the PHP file behind a web server. If you are trying to run a PHP file via CLI(command Line Interface), you'll not get those $_GET and $_POST variables.

But all is not lost. There is a work around to handle that problem and that is to use $argc and $argv variables.

$argc is the number of parameters passed in the command line while $argv holds the actual parameters stored in a zero based index array.

Example:
[ian@mycomputer]$ /usr/bin/php myscript.php hello world

$argc value will be 3. $argv will be an array of 3 strings containing "myscript.php", "hello" and "world."

Now back to our problem. To solve it, we will be using $argc and $argv to fill up the $_GET or $_POST variable. How?

Using a browser, to fill up the $_GET variable, you add the data by appending text to the URL.

Example:
http://test.com/myscript.php?name=ian&age=16

$_GET variable will contain the index 'name' with value 'ian' and index 'age' with value '16'.

To get the same thing using CLI, we use the following code:

function ArgsToGet($argv)
{
$gets = explode('&', $argv[1]);
foreach($gets as $g)
{
$g = explode('=', $g);
$_GET[$g[0]] = $g[1];
}
}

var_dump($argv);
ArgsToGet($argv);
var_dump($_GET);

?>

Example:
[ian@mycomputer]$ /usr/bin/php myscript.php 'name=ian&age=16'

Using the code above, the command will output will be
array(2) {
[0]=>
string(8) "test.php"
[1]=>
string(15) "name=ian&age=16"
}
array(2) {
["name"]=>
string(3) "ian"
["age"]=>
string(2) "16"
}

The variable $_GET will have the values same as it was when using a browser.