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 (  => Array (  => <a href="http://www.bjmckay.com">B.J. McKay</a>  => <a href="http://www.dallas.net">Dallas</a> )  => Array (  => http://www.bjmckay.com  => http://www.dallas.net )  => Array (  => B.J. McKay  => 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.
[The information provided is for educationally purposes only and not to be used for malicious use]
Before digging what actually SQL Injection is, let me explain you what is SQL it self.
What is SQL?
Structured Query Language (SQL) is a specialized programming language for sending queries to databases. Most small and industrial- strength database applications can be accessed using SQL statements. SQL is both an ANSI and an ISO standard. However, many database products supporting SQL do so with proprietary extensions to the standard language. Web applications may use user-supplied input to create custom SQL statements for dynamic web page requests.
What is SQL Injection?
SQL injection is a technique that exploits a security vulnerability occurring in the database layer of a web application. The vulnerability is present when user input is either incorrectly filtered for string literal escape characters embedded in SQL statements or user input is not strongly typed and thereby unexpectedly executed. It is in fact an instance of a more general class of vulnerabilities that can occur whenever one programming or scripting language is embedded inside another.
“SQL Injection” is subset of the unverified/unsanitized user input vulnerability (“buffer overflows” are a different subset), and the idea is to convince the application to run SQL code that was not intended. If the application is creating SQL strings naively on the fly and then running them, it’s straightforward to create some real surprises.
Many organization’s web servers has been compromised just because of SQL Injections, including big names which I would not like to mention here, you can search it easily on Internet.
What is Blind SQL Injection?
This particular type of attack is called a blind SQL injection attack, because the attacker cannot take advantage of detailed error messages from the server or other sources of information about the application. Getting the SQL syntax right is usually the trickiest part of the blind SQL injection process and may require a lot of trial and error. But, by adding more conditions to the SQL statement and evaluating the Web application’s output, an attacker will eventually determine whether the application is vulnerable to SQL injection.
Blind SQL injection a special case that plays on the web developers or website owners sense of security. While they may think that everything on the server is tightly guarded a Blind SQL injection attack will silently be playing truth or consequences with the web server. This type of attack though very time consuming is one that provides the most potentially damaging security hole. This is because an attacker gets not only access but is provided with an enormous amount of knowledge about the database and can potentially gain access to a servers file system. This type of attack is one that is automated and requires good amount of setup to succeed. But once it is done it does not require a great deal of effort to repeat.
What is Error message SQL Injection?
Web applications commonly use SQL queries with client-supplied input in the WHERE clause to retrieve data from a database. When a Web application executes such queries without validating or scanning the user-supplied data to ensure it’s not harmful, a SQL injection attack can occur. By sending unexpected data, an attacker can generate and submit SQL queries to a web applications database. A test for SQL injection vulnerabilities takes place by sending the application data that generates an invalid SQL query. If the server returns an error message, that information can be used to try to gain uncontrolled access to the database. This is the basis of one of the most popular SQL injection attacks.
Hiding error messages does not stop the SQL injection attack. What typically happens is the attacker will use the knowledge gained from the failure of this attack to change tactics. What they turn to is blind SQL injection.
Why SQL Injection?
When a web application fails to properly sanitize user-supplied input, it is possible for an attacker to alter the construction of backend SQL statements. When an attacker is able to modify a SQL statement, the process will run with the same permissions as the component that executed the command. (E.g. Database server, Web application server, Web server, etc.). The impact of this attack can allow attackers to gain total control of the database or even execute commands on the system.
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)
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.
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.
“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.
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.
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.
What is html5, and why you should use it?
HTML5 is a language for creating and laying out content for the web with a core technology throughout the internet. This has been the 5th revision and it was created in approximately 1990. The purpose behind HTML5 is improving the language which will support the latest and most innovated multimedia, understood by computer systems. If anything, this is a response to the observation and increase in technology, with different types of features which have been introduced by different specifications. This has been introduced by software products and web browsers.
It has defined markup language that can be written in the HTML form and it includes a very detailed process to encourage different types of software implementation. It will prolong, improve and make sense of the markups. There are new features that have been added, which includes audio and video as well as SVG content. These have been incorporated into the system to make the whole process much easier to handle media and graphics throughout the web without any separated plug ins. Content and documents are now enriched and redefined.
There are reasons as to why you should use HTML5 and it revolves around the way that you are going to use the web in general. Many are supporting in it, investing in it and wanting to be a part of the system. This is used in mobile web browsers and almost all of the websites that you visit, making the whole link process a lot easier on your behalf. There’s going to be a lot of marquee and headline changes thanks to Google, Mozilla and Apple.
There are super cookies which will give you much more space and very adequate application databases, such as email. Sites will include canvas drawing which will mark off a certain part of the page for pictures, charts, games and graphs; whatever feature can be included into the programming code, will be included.
There’s going to be an infinite amount of support going into audio streaming support, and it’s going to bring playback features to you in the case of an audio or video format. There are Geo-location features which can find your location and tailor around it so that there is more convenience in the things that you are typing into your search engine.
- HTML5 is very good because it improves the ability of search engines to understand the content and structure of a video
and provides greater accessibility.
- This is what many website owners will continue to take advantage of for the next few years.
here is going to be smarter search boxes, text boxes and controls which will allow you to send through email-less annoyance in general. The overall focus of HTML5 is to make the whole build, drag and drop tools easy to use. It’s a focus on web application and discussion boards or real time. It may seem like another language to you if you aren’t familiar with technology terms, but just know that it’s going to make your internet experience easier.