Archive for the ‘Programming’ Category

The file structure of the Zend Framework QuickStart Tutorial

Sunday, November 23, 2008 5:35 2 Comments

  I started working  through the tutorial for the PHP Zend Framework.  After few pages they  neglected to mention where the  piece of code is supposed to be. Maybe I learnt a lot more, but it did not make for a very ‘quick’ start to work out things go from the error messages. Here’s the [...]

This was posted under category: PHP Tags: , ,

class in php

Tuesday, November 18, 2008 9:32 No Comments

Class is nothing but binding the data. I’e variables and functions. In class we can have number functions. Class can be declare with a key word class followed by a class name, which can be any name. This name should not be key word in php. Followed by a pair of curly braces . Its [...]

This was posted under category: PHP Tags: , , ,

trim() in php

Tuesday, November 11, 2008 10:53 No Comments

If you use a form on your site then you’ll know that user input can often have white space before or after the text as the person filling in the form field sometimes accidentally adds spaces. This handy function will remove the whitespace from the beginning or end of the string. < ?php echo trim($_REQUEST['name']); [...]

This was posted under category: PHP

Using curl functions in php to send sms for smaple sms gateway

Saturday, November 8, 2008 11:42 14 Comments

This is a sample code assuming we have a sms gateway with name smsgateway.co.cc. We have take a sample $curlPost = ‘Mobile_No=9000099119&Type=SMS&Message=”This is a test message”‘; //we have to pass the mobile number and message as argument to the url. $LOGINURL = “http://smsgateway.co.cc/UserMiscellaneousMT.asp”; //This url will be provided by our gateway $agent = “Mozilla/5.0 (Windows; U; [...]

This was posted under category: PHP, Programming Tags: , , , , , , , , , ,

count() in php

Saturday, November 8, 2008 11:29 No Comments

The count() function is useful when you want to return how many elements are in your array. You can then use this in a for loop. Here’s an example we used earlier, only this time with the count function: $a[0]  = 2; $a[5]  = 3; $a[10] = 6; $totalsize = count($a); for($i=o;$i< $totalsize;$i++){ echo $totalsize[$i]; }

This was posted under category: PHP, Programming Tags: , ,