Sunday, 17 July 2022

PHP Concepts

What is PHP?

PHP stands for "PHP: Hypertext Preprocessor". Initially it was called "personal home page"
PHP is an opensource.PHP cost nothing, it is free to download and use
PHP is a scripting language designed for web.
PHP works with the web server. Ex: Apache, IIS, nginx etc which means that PHP scripts, or programs, usually run on a Web
PHP is an HTML-embedded scripting language. Much of its syntax is borrowed from C, Java and Perl. So if you have experience with this language, you will be comfortable with php
PHP is a one of the most popular Web programming languages. Using PHP we can build dynamic, interactive Web sites

Syntax

See the below table to get the opening and closing tags of php
Opening TagClosing Tag
<?php?>
<??> (Short Tag)
<script language='php'></script>

PHP File

PHP document with an extension of .php
PHP file contains HTML, CSS, javascript, user text, and php code
PHP code is parsed on the server. This method of code execution is called "Server Side Code".
Note: When code is executed in the browser We call that "Client-Side Code".Ex. Javascript
PHP statement ends with a semicolon(;)

PHP Works

PHP parser finds the requested file and scans it for php code.
When the PHP parser finds PHP code, it executes that code and sends back the output to a web server
Webserver sends it to a web browser and web browser displays the output on the screen


Evolution Of PHP

PHP was created by Rasmus Lerdorf way back in 1994. He released PHP to the general public in 1995 and called it PHP version 2
In 1997, two more developers, Zeev Suraski and Andi Gutmans rewrote most of PHP and, along with Rasmus, released PHP version 3.0 in June 1998.
The new version, PHP 4, was launched in May 2000.
PHP 5, released in July 2004

PHP Advantages

It is easy to learn
It is fast
It is inexpensive. (Free)
It is easy to use
PHP is cross-platform. It can run on many operating systems. Linux
Mac
Windows
Unix
Solaris
It is secure
It is designed to support databases-SQL
Mysql
Oracle
PostgreSQL
SQLite
IBM DB2
and More
It contains an Object-Oriented concept

PHP Comments

Generally, Comments in programming can remind you of what you were thinking when you wrote the code. A comment in a PHP code is used to understand the program works step by step and then Who created, Who Edited, last modified date, etc. A comment is simply text that is ignored by the PHP engine.

  1. <?php // This is a single line comment # This is also a single line comment /* This is a multiple lines comment This is a multiple lines comment */ ?>











Friday, 15 July 2022

PHP Introduction

PHP started as a small open source project that evolved as more and more people found out how useful it was. Rasmus Lerdorf unleashed the first version of PHP way back in 1994.

PHP is a recursive acronym for "PHP: Hypertext Preprocessor".

1) PHP is a server-side scripting language that is embedded in HTML. It is used to manage dynamic content, databases, session tracking, and even build entire e-commerce sites.

2) It is integrated with a number of popular databases, including MySQL, PostgreSQL, Oracle, Sybase, Informix, and Microsoft SQL Server.

3) PHP is pleasingly zippy in its execution, especially when compiled as an Apache module on the Unix side. The MySQL server, once started, executes even very complex queries with huge result sets in record-setting time.

4) PHP supports a large number of major protocols such as POP3, IMAP, and LDAP. PHP4 added support for Java and distributed object architectures (COM and CORBA), making n-tier development a possibility for the first time.

5) PHP is forgiving: PHP language tries to be as forgiving as possible.

6) PHP Syntax is C-Like.

Uses of PHP

* PHP performs system functions, i.e. from files on a system it can create, open, read, write, and close them.

* PHP can handle forms, i.e. gather data from files, and save data to a file, through email you can send data, and return data to the user.

* You add, delete, and modify elements within your database through PHP.

* Access cookies variables and set cookies.

* Using PHP, you can restrict users to access some pages of your website.

* It can encrypt data.


Characteristics of PHP

Five important characteristics make PHP's practical nature possible −

Simplicity

Efficiency

Security

Flexibility

Familiarity

"Hello World" Script in PHP

To get a feel for PHP, first, start with simple PHP scripts. Since "Hello, World!" is an essential example, first we will create a friendly little "Hello, World!" script.

As mentioned earlier, PHP is embedded in HTML. That means that in amongst your normal HTML (or XHTML if you're cutting-edge) you'll have PHP.

<html>

   <head>

      <title>Hello World</title>

   </head>

   <body>

      <?php echo "Hello, World!";?>

   </body>

</html>

(Output)   Hello, World!

If you examine the HTML output of the above example, you'll notice that the PHP code is not present in the file sent from the server to your Web browser. All of the PHP present on the Web page is processed and stripped from the page; the only thing returned to the client from the Web server is pure HTML output.

All PHP code must be included inside one of the three special markup tags ATE are recognized by the PHP Parser.


<?php  PHP code goes here   ?>

<?    PHP code goes here ?>

<script language = "php"> PHP code goes here </script>


The most common tag is the <?php...?> and we will also use the same tag in our tutorial.

In the next chapter, we will start with PHP Environment Setup on your machine and then we will dig out almost all concepts related to PHP to make you comfortable with the PHP language.












Thursday, 14 July 2022

History of PHP

PHP as it's known today is actually the successor to a product named PHP/FI. Created in 1994 by Rasmus Lerdorf, the very first incarnation of PHP was a simple set of Common Gateway Interface (CGI) binaries written in the C programming language. Originally used for tracking visits to his online resume, he named the suite of scripts "Personal Home Page Tools," more frequently referenced as "PHP Tools." Over time, more functionality was desired, and Rasmus rewrote PHP Tools, producing a much larger and richer implementation. This new model was capable of database interaction and more, providing a framework upon which users could develop simple dynamic web applications such as guestbooks. In June of 1995, Rasmus » released the source code for PHP Tools to the public, which allowed developers to use it as they saw fit. This also permitted - and encouraged - users to provide fixes for bugs in the code, and to generally improve upon it.

In September of that year, Rasmus expanded upon PHP and - for a short time - actually dropped the PHP name. Now referring to the tools as FI (short for "Forms Interpreter"), the new implementation included some of the basic functionality of PHP as we know it today. It had Perl-like variables, automatic interpretation of form variables, and HTML-embedded syntax. The syntax itself was similar to that of Perl, albeit much more limited, simple, and somewhat inconsistent. In fact, to embed the code into an HTML file, developers had to use HTML comments. Though this method was not entirely well-received, FI continued to enjoy growth and acceptance as a CGI tool --- but still not quite as a language. However, this began to change the following month; in October 1995, Rasmus released a complete rewrite of the code. Bringing back the PHP name, it was now (briefly) named "Personal Home Page Construction Kit," and was the first release to boast what was, at the time, considered an advanced scripting interface. The language was deliberately designed to resemble C in structure, making it easy adoption for developers familiar with C, Perl, and similar languages. Having been thus far limited to UNIX and POSIX-compliant systems, the potential for a Windows NT implementation was being explored.

The code got another complete makeover, and in April of 1996, combining the names of past releases, Rasmus introduced PHP/FI. This second-generation implementation began to truly evolve PHP from a suite of tools into a programming language in its own right. It included built-in support for DBM, mSQL, and Postgres95 databases, cookies, user-defined function support, and much more. That June, PHP/FI was given a version 2.0 status. An interesting fact about this, however, is that there was only one single full version of PHP 2.0. When it finally graduated from beta status in November 1997, the underlying parsing engine was already being entirely rewritten. Though it lived a short development life, it continued to enjoy growing popularity in the still-young world of web development. In 1997 and 1998, PHP/FI had a cult of several thousand users around the world. A Netcraft survey as of May 1998, indicated that nearly 60,000 domains reported having headers containing "PHP", indicating that the host server did indeed have it installed. This number equated to approximately 1% of all domains on the Internet at the time. Despite these impressive figures, the maturation of PHP/FI was doomed to limitations; while there were several minor contributors, it was still primarily developed by an individual.

Tuesday, 12 July 2022

Gray Hat Hacker

A grey hat programmer (additionally spelled grey hat programmer) is somebody who might abuse moral norms or standards, however without the malignant purpose attributed to dark cap programmers. 

Grey hat programmers might participate in rehearses that appear to be not exactly totally above board, yet are frequently working for the benefit of everyone. Grey hat programmers address the center ground between white cap programmers, who work for the benefit of those keeping up with secure frameworks, and dark cap programmers who act vindictively to abuse weaknesses in frameworks.

On the off chance that we consider white caps the police and the dark caps as crooks, then, at that point, the grey hats fill in as the marginally underhand investigator. Dark cap programmers are something of a wise guy; illicitly breaking and going into specialized frameworks similarly to a dark cap, however treating the material they find as a white cap. 

This could mean passing on a supportive note on the framework to make organizations mindful of their careless activities (like a robber who passes on a note to tell you you've left the tap running while you were on vacation); it could mean uncovering the data to the organization secretly to empower them to fix the blemish – or it could mean delivering the data publically, leaving the organization presented to dark cap programmers until they fix the issue.

In spite of the worries, the aptitude of grey hats can't be overlooked in such an ability short market. The lack of network protection abilities is very much revealed, leaving organizations presented to the activities of dark caps. 
McAfee's 'Hacking the Skills Shortage' referred to that 82% of respondents were influenced by a network safety lack, while an investigation by Indeed uncovered that digital protection work opening has ascended by almost a third in two years, bringing about the abilities hole ascending by 5% in the UK. 
Network protection Ventures predicts that worldwide spending on online protection will surpass $1 trillion over the course of the following five years and evaluations that there will be 1.5 million occupations opening by 2019. With a particularly extreme divergence among market interests, arraigning dark too as dark caps could have genuine repercussions for the network protection market.

Grey hat hackers useful

As we've effectively said, dark cap hacking is unlawful, paying little heed to the goal. In case there isn't authorization from the objective to discover weaknesses, attempting to break an organization's protection from the law. So a grey hat programmer ought to hope to be rebuffed by unveiling a weakness to an organization.

Notwithstanding, a few organizations utilize their bug abundance projects to urge dark cap programmers to report their discoveries, and will give the abundance to stay away from the more extensive danger of having the programmer utilize the weakness for their own benefit. However, this is moderately uncommon, so getting the organization's authorization is the best way to ensure that a programmer will be inside the law.






Saturday, 9 July 2022

E-commerce SEO

 Ecommerce keyword research

Keyword research is the critical first step in an e-commerce SEO campaign.

 You’ll target keywords too difficult to rank for and won’t make it to page one.

  1. You’ll rank for keywords that don’t garner traffic or cause customers to buy.

Neither of these situations is ideal, which is why e-commerce keyword research is so important — it will ensure you target keywords that are easy to rank for, have decent search volume, and have high conversion rates.

However, there is more to choosing keywords than simply looking at how difficult it is to rank or how many people search for them. The following four options can help you to perform e-commerce keyword research, find keyword difficulty (KD) and search volume, and uncover buyer intent:

 Right keywords

Unless you use a tool like Ahrefs, you likely won’t have keyword data for the phrases you picked. You need to determine keyword difficulty, search volume, and buyer intent to know which keywords to use.

Using Google Keyword Planner, you can find rough search volume and CPC to determine buyer intent. However, it doesn’t give you keyword difficulty (KD) or spread.

If you want to get serious about your SEO efforts and maximize your keyword spread, consider creating a keyword matrix.

A keyword matrix is a way to dig through relevant keywords and organize your spreadsheet to quickly determine the best possible keywords to use on each of your pages. It’s based on KD, search volume, and searches intent.

 Amazon for keyword research

Amazon is a gold mine of high buyer intent keywords since people typically search on Amazon with the intent of buying something.

To find keywords with Amazon, start typing in your seed keyword. In response, Amazon will spit out autofill suggestions. These are all keyword ideas — put them in a Google spreadsheet to keep for later.

As you can imagine, if you have hundreds or thousands of products, this could take a long time. That’s where the Amazon Keyword Tool comes in. 

This tool automatically scrapes Amazon’s autofill suggestions for any keyword you type in. Each time you search, check off all the keywords and add them to your list, then download that list to a CSV with the “Download Selected Keywords” button.

 keywords through competitor research

If you have competitors who rank higher than you in search results, you can use their site to take keyword ideas. First, type your keyword into Google, choose a competitor, and scan their category and product pages for potential keywords. 

It is important to remember that you shouldn’t blindly use the same keyword as your competitors simply because they outrank you — there are other factors such as domain authority. 

It is also critical to consider breadcrumbs, an advanced navigation function that helps Google scan and index your site. You can tell if you’ve set up breadcrumbs correctly by entering your site into Google. If you see “yoursite.com -> category -> subcategory”, you have breadcrumbs set up.

Ahrefs keyword opportunities

Ahrefs is an all-around, fantastic SEO tool. You can use it for keyword research, competitive research, building backlinks, and much more.

Through its easy-to-use system, you can view built-out reports of keyword rankings on your site and your competitors, allowing you to see how you stack up and where you can make improvements.

Friday, 8 July 2022

Phreaker

Phreaking is a slang term for hacking into secure telecommunication networks. The term phreaking originally referred to exploring and exploiting the phone networks by mimicking dialing tones to trigger the automatic switches using whistles or custom blue boxes designed for that purpose. Generally speaking, curiosity about how phone networks operated motivated phreaks, rather than a desire to defraud telecommunications companies. Phreaking has become synonymous with hacking now that networks have gone cellular and cracking them requires more clearly illegal methods.

Phreaks - a combination of phone and freaks - were a defined subculture in the 1970s. Using relatively low-tech hacks like the plastic whistle from Captain Crunch boxes to the do-it-yourself blue boxes, phreaks maintained a social network similar to that of ham radio enthusiasts. The rising complexity of network security meant that more explicit lines needed to be crossed in order to continue phreaking.

Possibly one of the first phreaking methods used was switch-hooking. It allows the placing of calls from a phone where the rotary dial or keypad has been disabled. It is accomplished by rapidly pressing and releasing the switch hook to open and close the circuit thus simulating the pulses generated by the rotary dial.

Now phreakers are seen as telecommunication hackers, active in phone cloning, bluehacking, network mimicry and other forms of cellular phone hacking.

Thursday, 7 July 2022

Hacktivism

What is hacktivism?

Hacktivism is the act of misusing a computer system or network for a socially or politically motivated reason. Individuals who perform hacktivism are known as hacktivists. Hacktivism is meant to call the public's attention to something the hacktivist believes is an important issue or cause, such as freedom of information, human rights, or a religious point of view. Hacktivists express their support of a social cause or opposition to an organization by displaying messages or images on the website of the organization they believe is doing something wrong or whose message or activities they oppose.

Motivates Hacktivists

Hacktivists usually have altruistic or ideological motives, such as social justice or free speech. Their goal is to disrupt services and bring attention to a political or social cause. For example, hacktivists might leave a visible message on the homepage of a website that gets a lot of traffic or embodies a point of view that the individual or group opposes. Hacktivists often use denial-of-service or distributed DoS (DDoS) attacks where they overwhelm a website and disrupt traffic. Hacktivists want others to notice their work to inspire action or change. They often focus on social change but also target government, business, and other groups that they don't agree with for their attacks. Sending a message and eliciting change trump profit motives for hacktivists.

Hacker and a Hacktivist

Hackers and hacktivists generally use the same tools and techniques to achieve their goals. Unlike hacktivists, hackers are not defined solely by social causes. The answer to the question, "Is hacktivism good or bad?" is a point of debate. The legality of hacktivist acts is less contentious.

DoS and DDoS attacks are federal crimes in the United States under the Computer Fraud and Abuse Act. Those types of attacks are illegal in many other places as well, including the European Union, the United Kingdom, and Australia. Website defacement, where attackers access a website and change its contents, is considered cyber vandalism and a crime. Corporate data theft is also illegal. Opponents of hacktivism argue that these acts cause damage in a forum where there is already ample opportunity for non-disruptive free speech. Others insist that such acts are the equivalent of peaceful protest and, therefore, are protected as a form of free speech. Hacktivists often consider their activities a form of civil disobedience, meaning they are willfully breaking a law to further their protest.

Types of hacktivism

Hacktivists use a variety of techniques to get their message across. Their tactics include the following:

Anonymous blogging.

Activists, whistleblowers, and journalists use this tactic. It protects the blogger while providing a platform for them to speak out about an issue, such as human rights violations or oppressive government regimes.

DoS and DDoS attacks

Hacktivists use these attacks to prevent users from accessing targeted computer systems, devices, or networks. DoS and DDoS attacks flood systems with traffic, overwhelm resources, and make them difficult to access.

Doxing

This involves the gathering of information -- through hacking or social engineering -- about a person or organization and making it public. The information is typically sensitive and is sometimes used in extortion schemes.

Geobombing

This technique enables internet users to add a geotag to YouTube videos to display the location of the video on Google Earth and Google Maps. Hacktivists use geobombing to display the location of videos posted by political prisoners and human rights activists.

Leaking information

This is a popular activist tactic. Typically, an insider source will access sensitive or classified information -- which implicates an individual, organization or government agency in an activity that reflects negatively on them -- and make it public. WikiLeaks is known for publishing leaked data.

RECAP

This software lets users search for free copies of documents that are otherwise only accessible by paying a fee to the United States federal court database known as Public Access to Court Electronic Records (PACER). RECAP is PACER spelled backward.

Website defacement

Hacktivists change a website's code or software so visitors see errors or messages expressing the attacker's point of view. The message may be threatening or embarrassing, or the attack may disable a key function of the site or software to get the hacktivist's message across.

Website mirroring

Here, hacktivists replicate a legitimate website's content but with a slightly different URL. This technique is often used to get around censorship that blocks a site. If a website has been censored, the hacktivist will duplicate the content and attach it to a different URL on a mirror site so the content is still accessible.






Microsoft Thwarts Chinese Cyber Attack Targeting Western European Governments

  Microsoft on Tuesday   revealed   that it repelled a cyber attack staged by a Chinese nation-state actor targeting two dozen organizations...