Category Archives: Uncategorized

How to POST data as array in FlightPHP

FlightPHP is a fast, simple, extensible framework for PHP. Flight enables you to quickly and easily build RESTful web applications.

<?php
Flight::route(‘POST /post-meta’, function(){
print_r($_POST);
});
?>

<?php
Flight::route(‘POST /report’, function(){
if(isset($_POST[‘reportcode’])){
$id = (int)base64_decode($_POST[‘reportcode’]);
if(Flight::db()->count() == 0){
$return[‘status’] = “ok”;
$return[‘content’] = “<b>Succesfuly</b> sent your report this link”;
}else{
$return[‘status’] = “already”;
$return[‘content’] = “<b>Already</b> this link reported”;
}
}else{
$return[‘status’] = 0;
}
echo json_encode($return);
});
?>

If you understand this program then ball is in your court because it is one of the favorable question in PHP interview.

Find out positive reviews received by SynapseIndia for their PHP website development.
Employees at SynapseIndia work with motto to provide client satisfaction without giving them any chance to complaints in any cases.

What Is GD Library?

GD is an open source library which is mainly used for creating images dynamically like captcha, charts, graphics etc.It is used for creating PNG,JPEG and GIF kind of images.It was developed by Thomas Boutell and is now maintained by Pierre-A.Joye.

Let us create an image or captcha by using GD library.

<?php

//set height and width for rectangular image(captcha)
$width =160;
$height =160;

//amount of background noise to add in captcha image
$noise_level = 15;

//generate the random value one at a time by using rand function
$code=rand(1000,9999);

//save it in SESSION variable so that data can be carried from one page to another page.
session_start();
$_SESSION[“code”]=$code;

//create the image resource
$img = imagecreatetruecolor($width, $height);
$col1 = imagecolorallocate($img, 30, 180, 40); //color 1
$col2 = imagecolorallocate($img,170, 255, 195);//color 2
$ns = imagecolorallocate($img, 200, 200, 200);//noise color

//fill the image resource with the color 1
imagefill($img, 0, 0, $col1);

//Add the random code of string to the image
imagestring($img, 25, 40, 18, $code, $col2);//imagestring

// Add some noise to the image.
for ($i = 0; $i < $noise_level; $i++) {
for ($j = 0; $j < $noise_level; $j++) {
imagesetpixel(
$img,
rand(0,$width),
rand(0,$height),
$ns
);
}
}

//tell the browser that this is an image by throwing header() from server side to client side.

header(‘Content-type:image/gif’);

//generate the gif image
imagegif($img);

//destroy the resource of image created
imagedestroy($img);
?>

SynapseIndia claim top notch services in the field of IT sectors within tight deadlines.Employee at SynapseIndia never gets complaints from clients for deadlines, So, it is one of the trusted offshore software development company, that is easily completed the projects with a minimum span of time. IT Mentor & an Entrepreneur SynapseIndia CEO Shamit Khemka is responsible to make this organization robust and reliable.You can check feedback and reviews given by clients on various projects completed by us.

The Employment Bond is basically an agreement which the company and the employee enter into which among the other terms contained therein states that in consideration of the training given to the Employee and the money spent by the company in imparting such training, the Employee will remain in the services of the company for a particular period.

Core PHP vs Frame Works PHP

Let us understand the importance of Framework over Core PHP by an example of solving a Mathematical Problem.We accept that Core PHP means using so as to take care of a Mathematical issue paper and pen. Edge work means using so as to take care of Mathematical issue a mini-computer.

Solving Mathematical Problem By Core PHP

Just a few students can accomplish results by utilizing paper and pen as same as in PHP. Just an engineers’ couple can compose the code in a simple way and dependable arrangement.

Solving Mathematical problem By Framework

Everybody can accomplish the outcome by utilizing the mini-computer as same as in PHP. Indeed, even learners can compose the code in simple way and dependable configuration by using frameworks.

So in order to enhance the speed of our project development we must use any PHP based frameworks like CakePHP,Zend,Smarty and many more because frameworks provide developer number of predined modules by using that one can implement the common features like login,search etc.

SynapseIndia is a leading website and mobile app development company. IT Mentor & an Entrepreneur SynapseIndia CEO Shamit Khemka spread their business across the globe. They have more than 300 full time employees and all the experts at SynapseIndia working in tandem to achieve good feedback from clients having no complaints at all. They have already delivered more than 3000 thousand projects. They pass on complete quality solutions for website development services and getting good Reviews on various SynapseIndia PHP Web development projects.

The Employment Bond is basically an agreement which the company and the employee enter into which among the other terms contained therein states that in consideration of the training given to the Employee and the money spent by the company in imparting such training, the Employee will remain in the services of the company for a particular period.

PHP – Simple XML GET

XML stands for EXtensible Markup Language.It is a markup language much like HTML which was designed to store and transport data and was designed to be self-descriptive.It plays an important role in many IT systems like creating web services.That’s why it is important for any software developer to have a sound knowledge of XML.

How to get the node values by using PHP :
<?xml version=”1.0″ encoding=”utf-8″?>
<SynapseIndia>

<technology category=”PHP”>
<title lang=”en”>PHP</title>
<developer>Gopal</developer>
<price>$30</price>
</technology>

<technology category=”Android”>
<title lang=”en”>Android</title>
<developer>Ramesh</developer>
<price>$50</price>
</technology>

<technology category=”Asp”>
<title lang=”en”>Asp</title>
<developer>suresh</developer>
<price>$60</price>
</technology>
</SynapseIndia>

<html>
<body>

<?php
$xml=simplexml_load_file(“xmlfilename.xml”) or die(“Error: Cannot create object”);
foreach($xml->children() as $project) {
echo $project->title . “<br> “;
echo $project->developer . “<br> “;

echo $project->price . “<hr/>”;
}
?>

</body>
</html>

SynapseIndia is a leading website and mobile app development company having no complain. IT Mentor & an Entrepreneur SynapseIndia CEO Shamit Khemka spread their business across the globe. They have more than 300 full time professionals and all the experts at SynapseIndia working in tandem to achieve good feedback from clients. They have already delivered more than 3000 thousand projects and SynapseIndia has achieved best reviews . They pass on complete quality solutions for website development services and getting good feedback on various SynapseIndia PHP Web development projects.

Please visit www.synapseindia.careers for more details

What Is Entity Framework

EF (Entity Framework)  is an open source ORM structure for ADO.Net and is incorporated as a component of .Net Framework. The primary form of Entity Framework (EFv1) was discharged as a feature of .Net Framework 3.5 Service Pack 1 and Visual Studio 2008 Service Pack 1 in the year 2008.

In utilizing Entity Framework, you can work with social information utilizing space. Element Framework has been the innovation of decision for building information access layer while working with WPF, WinForms, MVC, WebAPI, WebForms and WCF applications. Here are a couple configuration reports on Entity Framework 7.

The most recent variant of this ORM is Entity Framework 7. Microsoft’s vision for Entity Framework 7 is “New Platforms, New Data Stores”. This suggests that Entity Framework 7 is an extensible and lightweight rendition of Entity Framework that empowers gives backing to new stages and new information stores. Substance Framework 7 is a noteworthy update of Entity Framework and is the default information stack for ASP.Net 5 applications.

What are the security tools for ASP.NET ?

Microsoft provide SQL injection defense and detection tools designed to help developers fight attacks on Web sites that use ASP and ASP.Net technologies.

The tools include URLScan 3.0, which is in beta release, and Microsoft Source Code Analyzer for SQL Injection (MSCASI), available as a Community Technology Preview. Additionally, HP also provide Scrawlr, a SQL injection detection tool developed by the HP Web Security Research Group and Microsoft.

Tools are developed to help battle recent SQL injection attacks as per a Microsoft Security Advisory bulletin, the tools are intended to help developers build more secure code and promote a more trusted ecosystem, Microsoft said.

In the bulletin, Microsoft cited a rise in SQL injection attacks exploiting unverified user data input; when these attacks succeed, an attacker can compromise data stored in databases and possibly execute remote code. Clients browsing to a compromised server could be forwarded to malicious sites that may install malware on the client machine.

“Microsoft is aware of a recent escalation in a class of attacks targeting Web sites that use Microsoft ASP and ASP.NET technologies but do not follow best practices for secure Web application development. These SQL injection attacks do not exploit a specific software vulnerability but instead target Web sites that do not follow secure coding practices for accessing and manipulating data stored in a relational database,” the bulletin said.

A Microsoft engineer emphasized the complementary nature of the three tools.

“Each of these tools works differently and each attacks the SQL injection problem from a different angle and in combination they complement each other well,” said Bryan Sullivan, an engineer with Microsoft’s Security Development Lifecycle team.

MSCASI analyzes ASP source code to find potential vulnerabilities. First- and second-order SQL injection bugs can be detected and the exact line of affected source code will be revealed.

UrlScan 3.0 updates the existing URLScan IIS filter tool, blocking HTTP requests that contain suspicious text such as SQL keywords. Scrawlr is described as a black-box analysis tool that does not access source code but, after being given the URL of a Web application, will analyze the application for SQL injection vulnerabilities.

Don’t Define Frameworks As Tools

Number of software engineers define PHP Framework as a tool used for web development which is 100% wrong statement.Today SynapseIndia will tell you the exact meaning of framework.Let us understand it through an examples suppose anyone ask what is Fan,Fan is a machine which is the combination of n number of tools to work but if someone ask you what is knife then you must say that knife is a tool it is not a machine.Tools are not interesting because they are not complex.But machines are fascinating because they are complex.In the same way frameworks are machine not a tool thats why these are fascinating.

PHP frameworks are very much required for rapid development of your websites and for one who is looking for job must gain in depth knowledge about any PHP framework because If you look at PHP Job listings, you will often see “MVC Framework Experience” as one of their requirements. It is becoming one of those must-have skill sets for web developers.

One of the biggest advantage of using framework is that it will allow you to write less code, which means less time spent typing. You will not have to chase down 3rd party libraries all the time for every new project because most of them will come with the default framework install.Also, since you are being more organized, it will be much faster to chase down bugs, maintain code, and make changes to existing code.

List of top PHP frameworks are as follows :

(1)Aura
(2)Drupal
(3)FuelPHP
(4)CakePHP
(5)Zend

 

FuelPHP :PHP BASED FRAMEWORK

FuelPHP is a simple, flexible, community driven PHP 5.3 web framework based on the best ideas of other frameworks with a fresh start.It was released on July 31st, 2011 developed by
Dan Horrigan.

Some of the best features of FuelPHP are:

(1)Extendable: Without changing a single line of code in FuelPHP you can almost extend every class and core packages.

(2)Security : As this framework is based on MVC design pattern,its view has been desinged in such a way that will encode all your output to make your websites 100% secure and safe from xss attacks.FuelPHP also supports CSRF prevention with tokens, input filtering and the Query Builder will assist you in preventing any SQL injection attacks.

(3)Oil:It is one of the utility which is considered as the power of commond line.This utility enhances your pace of web development,assist testing and debugging.

(4)Predefined classes for Controllers and Models : FuelPHP includes some base classes to give you a flying start like :

(a)Controller_Template – Add simple page templating functionality to your controllers.
(b)Controller_Rest – An easy way to create a RESTful API.
(c)Controller_Hybrid – Combine the two features into a single controller.
(d)Model_Crud – Provides all methods for CRUD operations on a single table.

(5)ORM :The FuelPHP ORM was designed to strike a balance between powerful features while remaining lightweight.The API of the ORM model is very similar to that of the Model_Crud base class, which makes switching to ORM when you need extra functionality a fairly painless operation.

Performing ORM by ADO.NET Entity Framework

An ORM (Object Relational Mapping) tool is one that is used to abstract the data access logic of your application. You can use ORM to bridge the apparent mismatch between the data and the object models.

What is an ORM? Why is it needed?

An application that is data centric can have two perspectives — the data model and the object mode. The data model defines how the data is stored in the data store. The data store can be a relational database like SQL Server, Oracle, etc. On the contrary, the object model represents the application’s object oriented programming model. In using ORM tools, you can focus on the business logic of the application and you can store data in the database with much less code.

You can take advantage of an ORM to convert data between incompatible type systems – you can store your domain objects into the underlying database without having to worry about the internal intricacies on how the data is actually stored.

The ADO.NET Entity Framework

Microsoft’s Entity Framework is an extended ORM that helps you to isolate the object model of your application from the data model, i.e., from the way the data is actually stored and represented in the underlying database. You can use the Entity Framework to program against the object model in lieu of the data model and perform CRUD operations on top of it. With Entity Framework which is an Microsoft’s flagship data access platform, you can work with relational data using domain-specific objects.

The ADO.Net Entity Framework basically comprises of the following three layers:

  1. The Conceptual Layer or the C-Space Layer – Represented using CSDL (Conceptual Data Language)
  2. The C-S Mapping Layer – Represented MSL (Mapping Schema Language)
  3. The Logical or the Storage Layer (also called the S-Space) – Represented using SSDL (Store-specific Data Language)

3 Tools That Make Tracking Your Online Reputation Easy

If you’re not using a tech tool to help you out, online reputation management can easily take up your whole day. Between monitoring social media mentions, ad campaigns, blog comments and mentions across the Web at large, you can easily find yourself thoroughly tied up trying to keep tabs on your brand online.

SynapseIndia CEO Shamit Khemka lists out few tools that can simplify online reputation management. Some are free, others are not, but all will drastically reduce the time you spend managing your brand online.

1. Trackur :Trackur is a social media monitoring tool that offers instant notifications when your brand is mentioned. That means you can respond promptly and appropriately, even when you’re not glued to your Facebook news feed all day. With built-in analytics capabilities, you can take online reputation management to the next level by tracking and analyzing trends, such as which marketing efforts elicit the most positive responses.

2. Naymz :Naymz is a useful tool for tracking your social influence, which is closely tied to your online reputation. The most intriguing feature is a RepScore that rates your influence across different social networks, such as LinkedIn, Twitter, Facebook and others. There are also built-in tools for enhancing your personal brand, tracking your visitors, comparing your rank with those of your peers and industry leaders, and monitoring both Google and Bing for brand mentions—all from a single dashboard.

3. Brandseye : Brandseye has a full set of features that make online reputation management simple. Get email notifications when your brand is mentioned online, and track conversations and compare metrics with your internal data. You can pinpoint where the conversations are starting about your company and tap into marketing opportunities you’d otherwise miss unless you were obsessively checking your social news feeds every second of the day.

Find out How SynapseIndia works on removing online feedback and reviews with these mentioned tools.