Php tutorial-SYMBOLS

! (logical operator)
!= (comparison operator)
!= (inequality operator)
!== (comparison operator)
!== (non-identity operator)
$result->fetch_assoc() function
$type parameter
% (modulus operator)
% (wildcard character)
%= (combined assignment operator)
& (bitwise operator)
& (reference operator)
&& (logical operator)
+ (addition operator)
+ (plus symbol)
+ (union operator)
++ (increment operator)
+= (combined assignment operator)
, (comma operator)
- (subtraction operator)
— (decrement operator)
-= (combined assignment operator)
. (string concatenation operator)
.= (combined assignment operator)
/ (division operator)
/= (combined assignment operator)
< (comparison operator)
<< (bitwise operator)
<= (comparison operator)
= (assignment operator)
== (comparison operator)
== (equality operator)
== (equals comparison operator)
=== (comparison operator)
=== (identity operator)
?: (ternary operator)
@ (error suppression operator)

Brand Marketing-Publishing Information Using Online Brochures

Nearly every commercial website in the early 1990s was simply an online brochure or
sales tool.This type of site is still the most common form of commercial website. Either
as an initial foray onto the Web or as a low-cost advertising exercise, this type of site
makes sense for many businesses.

A brochureware site can be anything from a business card rendered as a web page to an
extensive collection of marketing information. In any case, the purpose of the site, and its
financial reason for existing, is to entice customers to make contact with your business.
This type of site does not generate any income directly but can add to the revenue your
business receives via traditional means.
Developing a site like this presents few technical challenges.The issues faced are similar
to those in other marketing exercises. A few of the more common pitfalls with this
type of site include
1 Failing to provide important information
2 Poor presentation
3 Failing to answer feedback generated by the site
4 Allowing the site to age
5 Failing to track the success of the site

Testing working using phpinfo()

Let’s install Apache, PHP, and MySQL under a Unix environment. First, you need to
decide which extra modules you will load under the trio. Because some of the examples
covered in this book use a secure server for web transactions, you should install an SSLenabled
server.
For purposes of this book, the PHP configuration is more or less the default setup but
also covers ways to enable the gd2 library under PHP.
The gd2 library is just one of the many libraries available for PHP.We included this
installation step so that you can get an idea of what is required to enable extra libraries
within PHP. Compiling most Unix programs follows a similar process.
You usually need to recompile PHP after installing a new library, so if you know
what you need in advance, you can install all required libraries on your machine and
then begin to compile the PHP module.
Here, we describe installation on an SuSE Linux server, but the description is generic
enough to apply to other Unix servers.
Start by gathering the required files for the installation.You need these items:
n Apache (http://httpd.apache.org/)—The web server
n OpenSSL (http://www.openssl.org/)—Open source toolkit that implements the
Secure Sockets Layer
n MySQL (http://www.mysql.com/)—The relational database
n PHP (http://www.php.net/)—The server-side scripting language
n ftp://ftp.uu.net/graphics/jpeg/—The JPEG library, needed for PDFlib and gd
n http://www.libpng.org/pub/png/libpng.html—The PNG library, needed for gd
n http://www.zlib.net/—The zlib library, needed for the PNG library, above
n http://www.libtiff.org/—The TIFF library, needed for PDFlib
n ftp://ftp.cac.washington.edu/imap/—The IMAP c client, needed for IMAP


Is PHP  Working?
Now you can test for PHP support. Create a file named test.php with the following
code in it.The file needs to be located in document root path, which should be set up,
by default, to /usr/local/apache/htdocs. Note that this path depends on the directory
prefix that you chose initially. However, you could change this in the httpd.conf file:
<?php phpinfo(); ?>

Query Strings

Query string data is very easy for the user to alter, because it ’ s visible and editable within the browser ’ s
address bar. Therefore, query strings should be used only in situations where sending incorrect data
won ’ t compromise security.

You also need to make sure you don ’ t rely on query strings to authenticate users, because people often
send URLs to friends in emails or instant messaging applications. If your URL contains all the data
needed to authenticate a user, and that user sends the URL to a friend, then the friend can pretend to be
them! You ’ ll find that sessions — discussed later in the chapter — are a much better way of authenticating
users.
If you ’ ve worked your way through Chapter 9 , you ’ re already somewhat familiar with the concept of
query strings. You ’ ll remember that you can embed sent form data in a URL by setting the form ’ s
method attribute to get . When the form data is sent to the server.

http://localhost/iscript.php?firstname=Tred & lastname=Fish& ...

the browser adds a query ( ? ) character to the end of the URL, then follows it with each
of the form fields as “name=value” pairs, with each pair separated by an ampersand ( & ).

Passing References to Your Own Functions php

By passing a reference to a variable as an argument to a function, rather than the variable itself, you pass
the argument by reference , rather than by value. This means that the function can now alter the original
value, rather than working on a copy.
To get a function to accept an argument as a reference rather than a value, put an ampersand ( & ) before
the parameter name within the function definition:
function myFunc( & $aReference ){
// (do stuff with $aReference)
}
Now, whenever a variable is passed to myFunc() , PHP actually passes a reference to that variable, so
that myFunc() can work directly with the original contents of the variable, rather than a copy.
Now that you know this, you can fix the earlier counter example by using a reference:
function resetCounter( & $c ) {
$c = 0;
}
$counter = 0;
$counter++;
$counter++;
$counter++;
echo “$counter < br/ > ”; // Displays “3”
resetCounter( $counter );
echo “$counter < br/ > ”; // Displays “0”
The only change in the script is in the first line:
function resetCounter( & $c ) {
Adding the ampersand before the $c causes the $c parameter to be a reference to the passed argument
( $counter in this example). Now, when the function sets $c to zero, it ’ s actually setting the value of
$counter to zero, as can be seen by the second echo statement.
Many built - in PHP functions accept references in this way. For example, PHP ’ s sort() function, which you
met in the previous chapter, changes the array you pass to it, sorting its elements in order. The array is passed
in by reference rather than by value, so that the function can change the array itself.

Facebook Marketing tips

Facebook Pages give your business a presence on Facebook to promote your
organization. Facebook Pages are the business equivalent of a Facebook
member’s profile. Members can become a fan of your Facebook Page  write on your Wall,
 learn about special promotions, upload photos, and join other members.


Facebook Pages found with a search engine are visible to non-Facebook members,
but they require the user to join Facebook.


The difference between Facebook Pages and profiles is that
Facebook Pages are public by default. That anyone can search
and find your Page with the Facebook search engine and with the Internet
search engines, such as Google and Yahoo, thereby helping your business
gain traffic and broadening.

Share your Page with other members to help you attract more fans.

Advertising on Facebook-you can  target an ad to a lot of people.

Make your album-start adding photos,products photos,Cover Photo.

Inbound links pointing with Online Promotion

Promoting your site to make more inbound links than your competitors,
from high PageRank sites, is the most important way to increase your search
engine rankings.

Register your feeds at news aggregators.

Make XML news feeds such as RSS and Atom to automatically syndicate your page content
to other sites.

Get listed in the major directories in the right category
   http://dir.yahoo.com
  http://www.dmoz.org
  http://www.business.com


Write articles on your  important topics for other sites.

Get listed in industry business directories and resource pages.

Search Engine Marketing Metrics

Search metrics help marketers improve website PR campaigns and conversion rate
optimization (CRO) efforts. By tracking your progress over time or against the competition,
you can optimize the effectiveness of your advertising budget. By running
controlled experiments to compare alternatives, you can quickly determine higher
return strategies. The type of analytics software that you choose to use is less important
than which metrics you choose to measure.

Search Marketing Strategy
Search marketing is all about strategy. It’s thinking about moves, trying them out,
measuring, making predictions, testing, and going back and trying them over and
over again until you find what works for your site.

 The mechanics of setting up PPC campaigns and site submission can be
successfully taught to relatively inexperienced personnel. The true work in search
marketing is in developing theory and testing it with enough statistical power, by
which we mean validity, to realize significant change. Web analytics information can
tell marketers the language and specific word combinations that are most frequently
used on a per-page basis within their sites. That info is the key to making
good ideas on where and at what level to expend financial resources for the benefit
of the company.

Practices for CRO

CRO uses what you already know about your customers and their psychology to your advantage
by using language, imagery, and a level of engagement that will make your site
stand out among those of your competitors.

CRO uses a wide variety of techniques, and
credibility-based web design, to convert prospects into buyers. By planning, designing,
and optimizing your website to persuade, you can ensure that it will act as a
more efficient sales tool.

10 factors that  can use to maximize your site’s conversion rate, including:
• Credibility-based design
• Easy navigation
• Logo credibility
• Memorable slogans
• Benefit-oriented headlines
• Best content placement
• Calls to action
• Benefit-oriented content
• Using “hero shots”
• Interactivity and engagement
You’ll learn how to stage your CRO campaign through the discovery, planning, and
optimization phases.

Advanced SEO tips 2013

XML Sitemap Submission-Submit your XML sitemap to Google, Ask and Bing.

Submitting your URL to more than 30 top search engines such as Google.

First testing  the keywords used on the page content  and keyword density.

Test Website load time.

Test links found on the page.

Blog Posting

Blog Commenting

Forum Posting

Directory Submission

Article Submission

Classifieds Submission

Social Bookmarking

Social Media Profile Creation

PDF Submission,

Video Optimization

Image Optimization

PPT Submission

Forum Profiles Creation 


Advanced-seo-interview-questions