Archive

Archive for the ‘web designer india’ Category

CodeIgniter – Extending the native ‘Model’ and make it your own.

October 3, 2011 Leave a comment

Hi All,

Today I took advantage of CodeIgniter’s ability to extend the native libraries, and I was well satisfied that it just works.

Codeigniter Development India

Let me elaborate, I’m in the process of creating models for my CI project, and realized that certain functions within the models were getting repetitive. Using CI’s ability to create my own custom libraries, I was able to create my own custom ‘Model’ which extends from the core ‘Model’ object. How this simple architecture has cleaned up my code is simply remarkable.

So read on…

CI has some pretty great documentation to get a beginner CI coder up to speed. In the case of using models, the docs says you need to extend from the CI’s core ‘Model’ object.Typically the code will be something like this:

—–

class Model_name extends Model {
	function Model_name() {
		parent::Model();
	}
}
-----
Given that Models are generally library functions to your database, certain 
functions like create,  read, update and delete would be common across all models.
 In which case the code will probably  start to look like this:
------
class Model_name extends Model {

	function Model_name() {
		parent::Model();
	}

	function create() {
		//do insert data into database
	}

	function read() {
		//do get data into database
	}

	function update() {
		//do update data into database
	}

	function delete() {
		//do delete data from database
	}
}
------

Imagine having to repeatedly write (opps, cut-and-paste) that same 4 (or more) functions to every model you create. A better way would be to consolidate those functions into a parent Model, and your models inherit from the parent their ability to create, read, update and delete.

One way you can do this is to just edit and insert these functions into CI’s native Model code which you can find in system/libraries/Model.php. But when it comes to upgrading the core when a new version is released, you may end up overriding those changes you need.

A much better way is to create your own model object called MY_Model and inherit it’s capabilities from the core Model. (Do note that ‘MY_’ is the default prefix set in CI for extending native libraries, but the prefix can be changed. Read the docs.)

This is how you do it, you create a new php file, MY_Model.php in the applications/libraries/folder. The code for MY_Model would look something like this:

——–

class MY_Model extends Model {

	function MY_Model() {
		parent::Model();
	}
	function create() {
		//do insert data into database
	}

	function read() {
		//do get data into database
	}

	function update() {
		//do update data into database
	}

	function delete() {
		//do delete data from database
	}
}
--------
Now, within your models at applications/models folder, you would do something like this:
class Model_name extends MY_Model {
	function Model_name() {
		parent::MY_Model();
	}
}

And within your controllers at applications/controllers folder, you would be able to access 
the common functions of create, read, update and delete as you would normally.
------
class Blogs extends Controller {
	function view() {
		$this->Model_name->read();
	}
}
------

And that’s it. I know it’s very skeletal, but it should give you some ideas on how to proceed to extend the native core libraries CI comes with. Of course, this method doesn’t just apply to ‘Model’, you can extend any of the CI core objects. The CI docs have a good intro to extending the native library.

Also, I would like to give a nod to Emram at PHPFour for his Extended Model for CodeIgniter which basically incorporates CakePHP-like model capabilities into the CI Model.

Do bear in mind his method is to replace the system/libraries/Model.php file which is not recommended, for reasons I mentioned before. However, you should be able to incorporate his work by extending from the native library.

Contact:

bhavinran07[@]gmail.com

Advertisements
Categories: CakePHP, CakePHP Developer India, freelance developer, Freelance PHP Developer, Freelance PHP Programmer, Freelance Programmer India, Hire Dedicated Programmer, Hire Dedicated Programmer India, Hire PHP Developer India, Hire PHP Professional, Hire PHP Professional India, Hire PHP Programmer India, iphone developer, JavaScript, joomla, joomla customization india, Joomla Developer, joomla developer india, joomla freelancer india, jquery, mysql, open sources developer india, oscommerce Customization, oscommerce developer, php, PHP Development, PHP Freelance, PHP Freelancer, PHP Freelancer India, php freelancing india, php freelancing india mumbai, Php programming, web designer, web designer india, Web Developement Company USA, web developer, web developer ahemdabad india, web developer india, Web development India, Wordpress Developer India, wordpress freelance developer, wordpress freelance programmer, wordpress freelancer, Wordpress Freelancer India, Wordpress Programmer, Wordpress Shopping Cart, Wordpress theme customization, wordpress theme integration, x cart development india Tags: , , , , , , , , , , , , , , , , , , , , , ,

Using regular expressions to extract content – php extract texts from html content

October 3, 2011 Leave a comment

PHP provides a number of really neat regular expression functions. You can find the list of the regex function at the PHP site.

But the one that I’ve had most fun with is the preg_match_all() function which I’ve been using to do content extraction from an HTML page.

I’m not going to explain what Regular Expression (regex) is in this post. There are whole books on just this one topic along; I would be crazy to think I can explain it all in just a few paragraphs. But in order for you to understand how to use the regex functions you need to have a basic understanding of regular expressions.

If you think back to your childhood days, you would remember a toy that you can match holes with shapes with the corresponding blocks – like the picture here. Well, regular expressions is very much like that toy, but instead you have define your own ’shape’ (or pattern as it’s known) and apply your content to it. Any text that matches the pattern will ‘fall’ through it.

Let’s say you have a block of text like below and you want to extract out the all links from, you can use preg_match_all to do just that.

$content = "He's goin' everywhere,
<a href=\"http://www.bjmckay.com\">B.J. McKay</a> and his
best friend Bear. Rollin' down to
<a href=\"http://www.dallas.net\">Dallas</a>, who's providin'
my palace, off to New Orleans or who knows where."

The pattern you want to look for would be the link anchor pattern, like 
<a href=”(something)”>(something)</a>. The actual regular expression might look something like
Once you have your pattern you apply the $content and $regex_pattern to preg_match_all() like this

$regex_pattern = "/<a href=\"(.*)\">(.*)<\/a>/";

Once you have your pattern you apply the $content and $regex_pattern to preg_match_all() like this
preg_match_all($regex_pattern,$content,$matches);
print_r($matches);

preg_match_all will store all the matches into the array $matches, so if you output the array, 
you’ll see something like this.
---------
Array
(
    [0] => Array
        (
            [0] => <a href="http://www.bjmckay.com">B.J. McKay</a>
            [1] => <a href="http://www.dallas.net">Dallas</a>
        )

    [1] => Array
        (
            [0] => http://www.bjmckay.com
            [1] => http://www.dallas.net
        )

    [2] => Array
        (
            [0] => B.J. McKay
            [1] => Dallas
        )
)
---------

From this array, $matches, you should be able to loop through and get the information you need.

I hope this has been useful to you. I know it doesn’t cover all the things this function can do, but for first-timers, it should be a simple look at a very powerful PHP function.

Incidently, PHP also provides the function preg_match(). The difference is preg_match() only matches a single instance of the pattern, whereas preg_match_all() tries to find all matching instances within the content.

Contact:

bhavinrana07[@]gmail.com

Categories: CakePHP, CakePHP Developer India, freelance developer, Freelance PHP Developer, Freelance PHP Programmer, Freelance Programmer India, Freelance web developer, Hire Dedicated Programmer, Hire Dedicated Programmer India, Hire PHP Developer India, Hire PHP Professional, Hire PHP Professional India, Hire PHP Programmer India, india web development, iphone developer, JavaScript, joomla, joomla customization india, Joomla Developer, joomla developer india, jquery, Magento, magento freelancer india, mysql, open sources developer india, oscommerce Customization, php, PHP Developer, PHP Developer India, PHP Development, PHP Freelance, PHP Freelancer, PHP Freelancer India, php freelancing india, Php programming, web design india, web designer, web designer india, Web Developement Company USA, web developer, web developer ahemdabad india, wordpress, Wordpress Blog Developer, Wordpress Customization Services, Wordpress Developer, Wordpress Developer India, wordpress freelance developer, wordpress freelance programmer, wordpress freelancer, Wordpress Programmer, Wordpress Shopping Cart, Wordpress theme customization, wordpress theme integration, x cart development india, x-cart Tags: , , , , , , , , , , , , , , , , , , ,

PHP Web Development, Custom PHP Development of India based OPS – Instant, Interactive, Inexpensive (freelance php developer programmer wordpress joomla drupal and many open sources, cakephp and many frameworks)

October 2, 2011 3 comments

PHP Web Development, Custom PHP Development of India based OPS – Instant, Interactive, Inexpensive (freelance php developer programmer wordpress joomla drupal and many open sources, cakephp and many frameworks).

😀

Need to develop website in PHP? Want to develop custom applications in PHP? Looking for PHP development services at affordable costs? Then your search ends here.

Outsourcing Programming Services (OPS) – A leading PHP development company from India offers PHP web developmentservices at cost effective rates. Develop your custom high end applications through PHP development services. Increase business efficiency level and reduce business overheads by outsourcing custom PHP development requirements to us.

Request a Quote to know your PHP development costs for FREE, visit: https://bhavinrana.wordpress.com/

PHP Development Services by OPS:

• Custom PHP Development: Customized development with desired features and dynamic functionality
• PHP Application Development: Develop business web applications with elegant application user interface design
• PHP eCommerce Website Development: eCommerce shopping cart development services using Magento, CS Cart, VirtueMart, X-Cart, Zen Cart, etc.
• PHP MySQL Development: Develop dynamic and database driven website applications with PHP and MySQL
• Open Source PHP Implementation and Customization: Helps to develop and implement PHP Open Source Applications for businesses on open source and PHP platform i.e. LAMP, WAMP
PHP Web Development with MVC architecture: Develop web applications using CakePHP, Zend framework and CodeIgniter.

Based in India, leading PHP Development Company provides total PHP development solutions for various businesses & industries. It has a team of best Indian PHP developers who has developed and delivered thousands of custom PHP applications at affordable rates.

Drop a brief of PHP development requirements and get assisted by PHP Development experts in almost no time.

Contact:

bhavinrana07[@]gmail.com

Categories: ajax, Androide developer, CakePHP, CakePHP Developer India, drupal freelancer india, Freelance PHP Developer, Freelance Programmer India, freelance web, freelance web designer, Freelance web developer, get a freelancer, Graphic Designer, Hire Dedicated Programmer, Hire Dedicated Programmer India, Hire PHP Developer India, Hire PHP Professional, Hire PHP Professional India, Hire PHP Programmer India, iOS, iphone 4, iphone application developer, iphone developer, iphone website designer, JavaScript, joomla customization india, Joomla Developer, joomla developer india, joomla freelancer india, jquery, mysql, open sources developer india, oscommerce Customization, oscommerce developer, php, PHP Developer, PHP Developer India, PHP Development, PHP Freelance, PHP Freelancer, PHP Freelancer India, php freelancing india, php freelancing india mumbai, PHP programmer, Php programming, web design india, web designer, web designer india, Web Developement Company USA, web developer, web developer ahemdabad india, web developer india, Web development India, Word Press Reserch, Wordpress Customization Services, Wordpress Developer, Wordpress Developer India, wordpress freelance developer, wordpress freelance programmer, wordpress freelancer, Wordpress Freelancer India, Wordpress Programmer, Wordpress Shopping Cart, Wordpress theme customization, wordpress theme integration, x cart development india, x-cart Tags: , , , , , , , , , , , , , , , , , , , ,

Google new chart API

September 28, 2011 Leave a comment

Hi All,

 

A new API from Google that generates information charts in a dynamic way. its usage is quite straightforward: you link to an image in the form of a parameterized URL, such as http://chart.apis.google.com/chart?cht=p3&chd=t:90,49&chs=400×200&chl=data|bling.

“cht=p3? is the chart type, in this case, a pie chart.

 

“chd=t:90,49? are the chart values, text-encoded, and separated by a comma.

“chs=400×200? is the custom chart size, 400 by 200 pixels.

“chl=Data|Bling” are the different labels for the pie chart sections, separated via the pipe character.

chart types include: line charts, bar charts, pie charts, Venn diagrams & scatterplots.

View Demo

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Categories: Androide developer, CakePHP, CakePHP Developer India, freelance developer, Freelance PHP Developer, Freelance Programmer India, freelance web designer, Hire Dedicated Programmer, Hire Dedicated Programmer India, Hire PHP Developer India, Hire PHP Professional, Hire PHP Professional India, Hire PHP Programmer India, Hire Web developer, iphone application developer, iphone developer, iphone website designer, JavaScript, jquery, mysql, php, PHP Developer, PHP Developer India, PHP Development, PHP Freelance, PHP Freelancer, PHP Freelancer India, php freelancing india, php freelancing india mumbai, PHP programmer, PHP Programmer India, Php programming, tips & trics, url rewriting, web design india, web designer, web designer india, Web Developement Company USA, web developer ahemdabad india, web developer india, Web development India, Word Press Reserch, wordpress, Wordpress Blog Developer, Wordpress Customization Services, Wordpress Developer, Wordpress Developer India, wordpress freelance developer, wordpress freelance programmer, wordpress freelancer, Wordpress Freelancer India, Wordpress Programmer, Wordpress Shopping Cart, Wordpress theme customization, wordpress theme integration, x cart development india, x-cart Tags: , , , , , , , , , , , , , , , , , , , , ,

PHP Development India – Best Language for Web Development

September 28, 2011 1 comment

Hi All,

In today’s advanced technological world, the popularity of the internet has been increasing and we see millions of websites running on the internet to fulfill the requirement of user and the figure keeps increasing each day. Therefore, the merchants are getting cut-throat competition on the internet. Strong representation of a website is thus necessary for its online success. Hence, merchants have been diverted to web development industry to build the strong online presence.

There are many options available for web development like php, asp.net, java, wordpress, etc., from them php becomes a first choice for company websites. Because PHP is an open source server side scripting language, which allows effective web development at affordable rates. PHP support multiple platforms and databases such as Linux kernel, MS Windows, MySQL, MS Access, SQL server & Oracle. It also offers an array of other features which can be used to make a website flexible and user-friendly.

Benefits of PHP Development:

  • Create a dynamic website that has a professional look
  • Its support various OS (operating system) like Windows, Linux and Unix
  • The coding is easily understandable
  • Web development at very affordable rates
  • Increase your ROI (Return of Investment)

Many countries provide php development services, from them India has taken first place in this field because Indian php developers offer excellent designing and development services and take new challenges with open arms and most important thing, you get your application at one-quarter of cost at your current rate.

 

 

Submit Form Using Ajax (Post)

September 24, 2011 1 comment

Post.html

<script type="text/javascript" language="javascript">// <![CDATA[
var h_request = false;
function makePOSTRequest(url, parameters) {
h_request = false;

<!--more-->

if (window.XMLHttpRequest) //MOZILLA
{
h_request = new XMLHttpRequest();
if (h_request.overrideMimeType)
{
h_request.overrideMimeType('text/html');
}
}
else if (window.ActiveXObject) { // IE
try {
h_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
h_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!h_request) {
alert('Cannot create XMLHTTP instance');
return false;
}

h_request.onreadystatechange = alertContents;
h_request.open('POST', url, true);
h_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
h_request.setRequestHeader("Content-length", parameters.length);
h_request.setRequestHeader("Connection", "close");
h_request.send(parameters);
}

function alertContents() {
if (h_request.readyState == 4) {
if (h_request.status == 200) {
result = h_request.responseText;
document.getElementById('myspan').innerHTML = result;
} else {
alert('There was a problem with the request.');
}
}
}

function get(obj) {
var poststr = "mytextarea1=" + encodeURI( document.getElementById("mytextarea1").value ) +
"&mytextarea2=" + encodeURI( document.getElementById("mytextarea2").value );
makePOSTRequest('post.php', poststr);
}

// ]]></script>

<form action="javascript:get(document.getElementById('form1'));" name="form1" id="form1">
<textarea id="mytextarea1">testing data
1
2
3
</textarea>
<textarea id="mytextarea2">testing data 2
4
5
6</textarea>
<br>
<input type="button" name="button" value="Submit"
onclick="javascript:get(this.parentNode);">

</form>

<br><br>
Server-Response:<br>
<hr>
<span name="myspan" id="myspan"></span>
<hr>

Post.php

<?
print_r($_POST);
?>
Categories: ajax, Androide developer, CakePHP, CakePHP Developer India, freelance developer, Freelance PHP Developer, Freelance PHP Programmer, Freelance Programmer India, freelance web, freelance web designer, Freelance web developer, get a freelancer, Hire Dedicated Programmer, Hire Dedicated Programmer India, Hire PHP Developer India, Hire PHP Professional, Hire PHP Professional India, Hire PHP Programmer India, Hire Web developer, Hire Web Developer India, india web development, Indian Freelancer, iOS, ipad, iphone developer, JavaScript, joomla, joomla developer india, jquery, mysql, oscommerce Customization, oscommerce developer, php, PHP Freelancer, PHP Freelancer India, php freelancing india, php freelancing india mumbai, PHP programmer, PHP Programmer India, Php programming, PHP Web Development, php web programmer, web designer india, Web Developement Company USA, web developer, web developer ahemdabad india, web developer india, Web development India, Word Press Reserch, wordpress, Wordpress Blog Developer, Wordpress Customization Services, wordpress freelance developer, wordpress freelance programmer, wordpress freelancer, Wordpress Freelancer India, Wordpress Programmer, Wordpress Shopping Cart, Wordpress theme customization, wordpress theme integration, x cart development india Tags: , , , , , , , , , , , , , , , , , , , ,

Hire PHPBB Developer for Robust Web Forum Development

September 21, 2011 Leave a comment

In the online business, businessmen suppose to be using various web techniques to promote the business on the web. The more interaction with the related entities can open the more avenues for the business and one of the best modes of interaction and sharing information on the web is forums.Internet forums with business websites can do amazing business promotional work. Developing web forum involves a fair programming work that is complex for novice businessmen. One of the popular & unique PHPBB (PHP Bulletin Board) systems for developing robust internet forums to business websites is available in the web development. PHPBB softwareis based on PHP programming language. However, web forums can be developed using various other computer programming languages such as Perl, Java and ASP. Internet forum development for websites is complex and costly process. Businessman can hire PHPBB developer / programmerfor making it cost-effective & customize to use with business website.

Internet forums are efficient tool to use with business as they incredibly great source to reach and converse with people. Designing, developing and hosting of internet forums is costly process and small businessman or online business company suppose to seek affordable alternative. As PHP is an open source scripting language and hire dedicated PHPBB developer is the best option that can save precious money. He can specially build or performPHPBB development, customize it and host cost – effectively. Anyone in the online business can hire PHPBB Developer from PHP Web Development Company. The concept of hiring dedicated developer is popular in the present times, which is very helpful in technical terms as well as in the matter of affordability. Customized designing, development and hosting all three can be derived from one professional. Moreover, a hiredPHPBB Developer can provide the benefits or implement the features of all updated versions such as PHPBB2 & PHPBB3 into business.

Categories: .htaccess, CakePHP, CakePHP Developer India, freelance developer, Freelance PHP Developer, Freelance PHP Programmer, Freelance Programmer India, freelance web, freelance web designer, Hire Dedicated Programmer, Hire Dedicated Programmer India, Hire PHP Developer India, Hire PHP Professional, Hire PHP Professional India, Hire PHP Programmer India, Hire Web developer, Hire Web Developer India, india web development, Indian Freelancer, iphone 4, iphone application developer, iphone developer, JavaScript, joomla customization india, Joomla Developer, joomla developer india, jquery, mysql, php, PHP Developer, PHP Developer India, PHP Development, PHP Freelance, PHP Freelancer, PHP Freelancer India, php freelancing india, php freelancing india mumbai, PHP programmer, Php programming, web designer india, Web Developement Company USA, web developer, web developer ahemdabad india, web developer india, wordpress, Wordpress Blog Developer, Wordpress Customization Services, wordpress freelancer, Wordpress Freelancer India, Wordpress Programmer, Wordpress Shopping Cart, Wordpress theme customization, wordpress theme integration, x cart development india, x-cart Tags: , , , , , , , , , , , , , , , , , , ,
%d bloggers like this: