User Guide to begin learning how to build dynamic PHP applications

User Guide to begin learning how to build dynamic PHP applications

Demand of PHP is evident from the fact that the world’s top websites, like Facebook, Google, Wikipedia, and YouTube, are using PHP scripts at the backend. PHP is helpful in developing dynamic websites. It is a server-side scripting language that sends information directly to the server when a user submits a form. Before going towards the step-by-step guide on how to write PHP scripts, I will give you a general overview of PHP.

php guide

What is PHP?

First introduced by Rasmus Lerdorf, PHP is an open-source, server-side general scripting language that has now become a de-facto coding standard in the web development industry. It can be learned easily, and if one is from a coding background, he (or she) will find it very simple. This is why many are using PHP to polish up their entry-level coding skills.

PHP runs on different operating systems, like Windows, UNIX, Linux and supports different databases like MySQL, Microsoft Access, and Oracle. PHP can not only collect form data, but it can also create, read, write, delete, and close files on the server.

It can be easily embedded in HTML. PHP code is embedded in HTML with tags <?php ?>.

Example

12345678910<html><title>GettingStartedWithPHP</title><body><?phpecho”Your first PHP code”;?></body></html>

PHP is different from client-side scripting languages. PHP code is executed on the server side resulting in generation of HTML, which is then sent back to the client-side (for e.g., your browser) for execution.

Where to use PHP code?

You can use PHP to create dynamic web pages, collect form data, and send or receive cookies.

Applications of PHP Scripts

Let us see how many ways PHP scripting is used.

Server-Side Scripting

Server side scripting is the first purpose of PHP. All you need to start working on a desktop PC with PHP is a PHP Parser, a webserver (such as Apache) and a web browser like Google Chrome.

Command Line Scripting

If you want to use PHP on Linux or task scheduler on Windows, then you don’t really need a web server, but only a PHP Parser. This is called “command line scripting”.

Desktop Applications

Although, PHP is not a suitable language for development of desktop applications, but it supports some advanced features like PHP-GTK which is basically an extension of PHP. PHP-GTK provides object-oriented user interface.

PHP enables you to choose not only the operating system of your choice but also allows you to have choices to use a web server that you are familiar with. It also enables beginners and professionals to write scripts in their own ways as it allows procedural as well as object-oriented programming.

PHP not only enables you to output HTML but also lets you include images, PDFs, videos, and sounds. PHP can auto-generate XHTML and XML files.

PHP provides support to protocols like LDAP, HTTP, COM, POP3, etc. It also supports WDDX complex data exchange.

Pre-requisites of PHP

Before you start learning PHP, you need to learn some basics of HTML (Hypertext Markup Language), SS(Cascading Style Sheets) and Javascript.

How to install PHP

Before starting PHP, you need a web host with PHP and MYSQL. For this, you should also install a web server such as Apache. To do it locally on your PC, you may download XAMPP directly from Apache Friends.

Installation of Apache, PHP, MySQL, and PHPMyAdmin

In order to install PHP, MySQL, PHPMyAdmin and Apache in a single attempt, XAMPP should be installed.

Scroll over to XAMPP for Windows and download should begin shortly.

what is XAMPP

Click the .exe file to start the installation procedure.

setup xampp

Select the components which you want to install and click “Next”.

Xampp Server

In the components area, you can view several options. As a beginner, you don’t need all of them. You need to install Apache, which is a very famous web server. It manages client responses. For data storage and view, you need a database such as MySQL. Filezilla FTP server option is not needed for performing operations at localhost. Next option is the Mercury Mail Server option. Its primary function is to deal with emails received by the server. It is needed to enable the flow of emails, which is not a requirement at the moment. Tomcat is also a web server owned by Apache.

php hosting signup

Coming down to programming languages, PERL (which is also a high-level programming language) is not a need at the moment. PhpMyAdmin is the admin panel of database and is needed. Webalizer is an application for analysis and you need to install it for monitoring purposes. Fake Sendmail is also an application that will be explained later.

Select your desired location, where you want to install XAMPP and then click “Next”.

installation Xampp

Click “Next” on the coming screens to proceed with the installation process.

installation Xampp
Welcome Xampp

Now, you will see the final screen. I would suggest that you keep the “start the Control Panel” option checked. Click “Finish” to complete the installation process. A new window will open shortly.

Xampp setup wizard

The XAMPP Control Panel has now started. Now, click “Start” button in Apache and MySQL rows to begin.

Xampp Control Panel
Xampp Control Panel

You are now ready to start writing the code. Now all you need is an editor like Notepad++ or Dreamweaver to write the code.

After downloading Notepad++, you can start writing your code

<?php
echo “My first PHP Script”;
?>

Now, save the page as “test.php” in htdocs folder and click “Save” button.

test.php

Now, open a web browser and type localhost in the address bar. It will automatically open the index file but if you type localhost/test.php, it will open the page that we have saved.

my first php page

Consider another example.

<!DOCTYPE html>
<html>
<head>
<title>Getting Started With PHP</title>
</head>
<body>
<h1>Beginners Guide For PHP</h1>
<p>Tutorial Series For Learning PHP</p>
<?php
echo “2+3″.”<br/>”;//It will display the output 2+3
print “2+3”;// print will also display the output 2+3
?>
</body>
</html>

In this example, we use echo and print to show the same result. Here is the output we get.

beginners guide for PHP

You can see that the two lines of 2+3 are displayed as output by using different statements. Most of the professional programmers prefer to use echo because echo can bring up multiple strings or values at the same time, whereas print displays one statement at a time. Both echo and print can be used with or without parentheses; print() or echo(). Also, it is to be noticed that you can not see the sum of two numbers without using variables. The concept of variables will be introduced along with PHP data types in the next tutorial.

Consider the example below.

<!DOCTYPE html>
<html>
<head>
<title>Getting Started With PHP</title>
</head>
<body>
<h1>Beginners Guide For PHP</h1>
<p>Tutorial Series For Learning PHP</p>
<?php
$a=99;
$b=”Calculus”;
echo “Numbers you have got in $b are $a”.”<br/>”;
echo ‘Numbers you have got in $b are $a’;
?>
</body>
</html>

In this example, you can see that we have echoed the same string with double quotes and single quotes. Here is the output.

beginners guide php

When we use double quotes, it displays the string along with the values assigned to variables $a and $b. However, when we use single quotes, it will treat the whole statement as string and will display variables $a and $b. I will touch upon the concept of variables in detail in the next tutorial as well.

For now, congratulations! You have just executed your very first PHP scripts! In the upcoming weeks, I will be discussing more about PHP; from the most basic tutorials to the most advanced. I hope to see you around for more PHP tutorials.

PART 2: Data Types And Variable Concepts

In the meanwhile, you can sign up and deploy PHP on the revolutionary managed Cloud Hosting Platform. Choose your cloud provider from some of the best infrastructures around, namely Google Compute Engine, DigitalOcean and Amazon Web Services. It will take you less than 6 minutes to sign up, choose the cloud provider and deploy PHP on your selected cloud provider. It is fast and secure. Plus, you are always covered with a 24/7 support team that never keeps you at bay!

Soa Technology

Can I make 6 million a year selling on Amazon?

Can I make 6 million a year selling on Amazon?

Yes you can. There is actually an incredible success story of a 21-year old college kid who setup his Amazon business. Grew his sales from 0 to 93 million. Then sold his entire business for an Amazing $75 million!

So yeah you can get very, VERY rich with selling on Amazon. Personally I am not quite there yet, as I am “only” making $19k a month.
I started selling on Amazon about 3 years ago, and although it is hard work, it definitely paid off ! Over these 3 years I have learned some valuable lessons and setup my own checklist of what to look for when picking a product to sell on Amazon:

  1. Product must be simple to manufacture!
    We want to keep it as simple as possible and don’t take any risks with hard to manufacture products.
  2. Low competition
    The competition should have around 50 reviews or less.
  3. High demand
    At least $3000 revenue per month for competitors in my niche.
  4. Sales Price: $15 +
  5. Healthy profit margin
    Profit margin should be at least 33% of the sales price. So I want to make at least $1k per month on this product

This is just the basics. However, if you are really serious about starting a FBA business as well you can check out this post about

STRANGE AND SCARY IOT HACKS

STRANGE AND SCARY IOT HACKS

The Internet of Things has provided a worldwide digital playground for hackers, pranksters and those who would thwart them and here are 9 of the most unnerving.

Here’s the Thing …

It’s no secret that the issue of IoT security is a Very Big Deal these days. Our brave new world of perpetually connected devices—appliances, cameras, thermostats, cars—has created a proportionately huge world of network security problems. The essential dilemma is that all these Internet-connected “smart” devices are often unprotected and easy to hack. Depending on the situation, they can leak sensitive data, generate worrisome surveillance problems, or even present legitimate physical dangers.

IoT security is an enormous, complicated, and really quite serious topic.
Those in the market for in-depth analysis will want to consult our more sober assessments. Here we take a high-altitude POV, looking at IoT hacks that have made headlines in recent years, with an eye toward the weird, the funny, and the scary.

Everyone knows someone who doesn’t take the security of home appliances seriously enough. These are the stories you need to help them focus.

Display Alll Product in one Page in opencart

Display Alll Product in one Page in opencart

  1. You have to create separate page for displaying all products.
    1. Create Model file catalog\model\catalog\allproduct.php and paste code this http://pastebin.com/suF5TP3z
    2. Create Controller file catalog\controller\productallproduct.php and paste below code http://pastebin.com/jZq3hZyc
    3. Create View file catalog\view\theme\default\template\productallproduct.tpl and paste below code http://pastebin.com/1HNh3x734 . Create Language file catalog\language\en-gb\product\allproduct.php and paste below code http://pastebin.com/EcyJH7F9
      1. Enable module from back-end You can see link in menu

  2. Display All Category in Menu
    1. Open and edit your category:
    2. Select tab Data:
    3. Find and Check:Top: Display in the top menu bar.

      Note : Only works for the top parent categories.You will need to check all the top level categories.It’s Opencart bugs.

OpenCart 2.x./3.x. How to set up specials and featured products

OpenCart 2.x./3.x. How to set up specials and featured products

It is essential to learn how to manage your store’s product inventory using the OpenCart administration side.  The following tutorial will show you how to set up specials and featured products in Opencart themes.

A special price is a products sale price. This type of pricing is better used as a short-term tactic during the holiday season or sales week.

Here’s how to define a special product in OpenCart:

  1. First of all, navigate to Catalog->Products in your admin dashboard.
  2. Search for the product you would like to be set as special. Click the Edit link to modify it.
  3. Then choose Special tab.
  4. You will have to fill in following fields:
  • Customer Group – optionally select a customer group you want this special to be applied to.
  • Priority – if you offer multiple specials and/or discounts, enter 1 for this to be applied first, 2 for this to be applied second.
  • Price – the price you want the customer to see.
  • Date Start – when you want this special price to appear.
  • Date End – when you want this special price to disappear.

To set the product as Featured you will have to do the following:

  1. Navigate to the Extensions -> Extensions section and choose Modules in the dropdown.Open the Featured – Featured Home module for editing.
  2. Start typing desired product name in the Products field. After this you will be able to select the Product out of the list and choose it as your  Featured product.
  3. Press Save button to save the changes.

This is the end of the tutorial, now you know how to set up specials and featured products in OpenCart.

How to Talk About Salary in a Job Interview

How to Talk About Salary in a Job Interview

There are a few reasons employers ask this question. In most cases, the company has budgeted a pay range for the role. They want to be sure that your expectations are consistent with that budget before moving forward.

Another reason is that, should things continue to go well, your potential employer wants to put together an offer that is compelling and exciting to you. This question opens up an opportunity for you to consider and discuss the salary as well as other benefits that interest you.

Here are several guidelines that can help you steer the conversation:

1. Know your worth

Each job has a general market value. You can learn the compensation range for your job on Indeed Salaries, where you can search by job title and location to narrow in on current compensation rates in your field.

Before you share your salary expectations with an employer, think holistically about what you’re earning presently, including salary, bonuses and benefits. Then, use the research you’ve done to set a realistic target for what kind of compensation you want in your next job. What base salary are you looking for? Which benefits do you value the most? What other perks interest you?

If you’re changing career tracks or interviewing for a job at a company that’s structured differently from your last employer, you should be able to articulate what you’re gaining or losing in terms of compensation.

2. You don’t have to answer salary questions right away

The requirements of a job as well as the other kinds of compensation an employer offers, like benefits, equity and bonuses, are important to take into consideration. When you are first asked, “What are your salary expectations?” it’s ok to delay answering. Here are some responses that can help you continue the conversation and get more information:

  • “I’m looking for a competitive offer that includes benefits and other kinds of compensation, but I’d like to know more about the specifics of what this job requires first.” (This answer is good for most situations)
  • “Over the course of my career, I’ve worked in several different areas, across different levels. I’d like to learn more about what this role entails as well as the benefits and other forms of compensation you offer.” (This may be a better answer if you’re transitioning to a new career track)

3. Give a salary range, not an exact number

If you’ve delayed answering the question and the interviewer asks you again, it’s time to respond. Avoid giving a specific number. Instead, you can provide a range. Cite your research and frame the conversation as being about what is fair rather than what you want. Here are some examples of how to answer:

For the less experienced candidate:

  • “I understand from my research and experience that low 50s to mid-60s is the competitive range for this role in this industry and city.”
  • “In this environment and in this location, my research indicates that mid-50s to low-70s is a reasonable range.”

For the more experienced candidate:

  • “Based on my experience in this field and my research on the current market, I understand that mid 70 to low 90s is a competitive range.”

Leave it there. Wait to negotiate further until you have a formal job offer in hand.

To sum up, here’s what you need to remember when talking about salary in an interview:

  • Know your worth and the forms of compensation that matter most to you.
  • Use salary resources like Indeed Salaries to study the current trends and learn about the range for this job in your city.
  • Give a range, not a specific number. Frame the conversation about salary around what is fair and competitive.
  • Don’t try to negotiate until you have a formal job offer.

Email Examples: How to Respond to an Employer Interview Request

Email Examples: How to Respond to an Employer Interview Request

When an employer responds to your job application with an interview request, you want to get back to them quickly and with enthusiasm. If you applied through Indeed, emails from employers will have the subject line “Response to application on Indeed.” Be sure to check your email settings and spam folders so you won’t miss their messages.

In your responses, keep your tone professional and upbeat. Avoid emojis, emoticons and slang. Proofread your messages for typos before you hit send. Here are four email examples to get you started.

If an employer requests an interview

In this case, you should send your response the same day. This shows enthusiasm for the role and respect for the employer’s time.

Begin your email with a note of thanks. If possible, agree to the employer’s suggested day and time. However, if you are currently working and your schedule is not flexible, most employers will accommodate your situation. Below is a sample email to consider if an employer contacts you requesting an interview:

Dear Ms. Wade,

Thank you for your consideration and the invitation to interview for the Social Media Manager role at XYZ Company. I am available this Wednesday at 1:30 pm, and I look forward to meeting with you to discuss this position in more detail.

Please let me know if I can provide any additional information prior to our meeting on Wednesday afternoon at your offices.

Sincerely,

Jaime Jones

Phone: (555) 555-1234

The response is short, clear and positive. It reinforces the date and location of the interview. There’s no need to include additional details—you’ll discuss the specifics during the interview.

If an employer asks you to call to schedule an interview

Another type of email you might receive from an employer is a request to call the employer’s offices to schedule an interview. Even though the employer wants you to call, you could also consider sending a brief confirmation email. Here’s an example:

Dear Ms. Wade,

Thank you for considering me for the Social Media Manager role at XYZ Company. Per your request, I will call you tomorrow afternoon to arrange for an interview.

I look forward to speaking with you. Please let me know if I can provide any additional information.

Sincerely,

Jaime Jones

Phone: (555) 555-1234

If an employer asks you follow-up questions

Finally, an employer might email you with follow-up questions. These questions are essentially a preliminary interview, so respond with professionalism and detail:

  • When asked company-related questionsProvide specific, detailed responses. Research company information (including corporate blogs and social media channels), and adapt the language you find there into your own words.
  • When asked about your pay or salary requirements
    Employers ask this question because they want to know your expectations are aligned ed with what they can offer. You have a few options when answering this question. One is to delay talking about pay until you know more about the job. An example response could be: “I’m looking for a competitive offer that includes benefits and other kinds of compensation. I’d like to know more about the specifics of what this job requires first.”Another option is to provide a range instead of one number. If you’re only interested in this job if it pays a specific amount, be honest. This can help you and the employer determine if this is a match early on.  
    • For more example responses to this question, review How to Talk About Salary in a Job Interview.
    • When asked questions about your own career pathAlign information from your resume with the job description to make natural connections. Be sure that your enthusiasm for the position and the industry are apparent.
    • If asked about skills you don’t have
      Be truthful. Instead, discuss transferable skills, proof of adaptability, ability to acquire new skills quickly, and a willingness to learn. In today’s job market, it’s rare that candidates have all the listed qualifications, so don’t be intimidated or discouraged. Instead, provide examples that show you can learn and grow as an employee.
    The following template provides sample opening and closing statements you can use when replying to an employer who asks follow-up questions in an email. This strategy can help move the process to the interview scheduling stage: Dear Ms. Wade,Thank you so much for considering me for the Social Media Manager role at XYZ Company. I’ve outlined responses to your questions below.[INSERT YOUR SPECIFIC ANSWERS]I appreciate the opportunity to provide this additional information, and I look forward to speaking with you and members of your team soon.Sincerely,Jaime JonesPhone: (512) 555-1234 If an employer asks you to email to schedule an interview Employers sometimes request that you email another individual to schedule an interview. This will likely be someone you have not contacted in the job application process. In this case, you must write two emails: a reply to the employer’s email and another to the person arranging the interview. Again, it’s important to respond promptly to the employer and remain brief in your reply. In the second email, you’ll need to provide context for the reason you’re writing. Here are two templates to help you navigate both situations: To the employer Dear Ms. Wade,Thank you for considering me for the Social Media Manager role at XYZ Company. Per your request, I will email Kate Duran to arrange for an interview. I look forward to speaking with you and additional members of your team.Please let me know if I can provide any further information in the meantime.Sincerely,Jaime JonesPhone: (555) 555-1234 To the person arranging the interview Dear Ms. Duran,I received an email today from Elaine Wade requesting that I contact you to schedule an interview for the Social Media Manager role at XYZ Company. At your convenience, please let me know when you have openings in your schedule.I am excited to learn more about the opportunities at XYZ Company and look forward to discussing the role in greater detail.Sincerely,Jaime JonesPhone: (555) 555-1234 If your schedule isn’t flexible, let this second email recipient know. You can add a few more sentences in the first paragraph that explain your circumstances. For example: …At your convenience, please let me know if you have openings in your schedule. Though I currently work standard business hours, I am available for interviews during lunch hours, before 9:00 am and after 5:00 pm. Is it possible to schedule an interview during these times? If not, please let me know so that I can arrange time off for the interview. Your response to an employer’s request is the beginning of your communication. Set a great tone in that first response, and you may improve your chances of moving forward in the hiring process.

how can I recursively delete empty directories in my home directory?

how can I recursively delete empty directories in my home directory?

The find command is the primary tool for recursive file system operations. Use the -type dexpression to tell find you’re interested in finding directories only (and not plain files). The GNU version of find supports the -empty test, so

$ find . -type d -empty -print

will print all empty directories below your current directory.

Use find ~ -… or find "$HOME" -… to base the search on your home directory (if it isn’t your current directory).

After you’ve verified that this is selecting the correct directories, use -delete to delete all matches:

$ find . -type d -empty -delete

Starting and Stopping httpd

Starting and Stopping httpd

After installing the httpd package, review the Apache HTTP Server’s documentation available online at http://httpd.apache.org/docs/2.2/.

The httpd RPM installs the /etc/init.d/httpd script, which can be accessed using the /sbin/servicecommand.

Starting httpd using the apachectl control script sets the environmental variables in /etc/sysconfig/httpdand starts httpd. You can also set the environment variables using the init script.

To start the server using the apachectl control script as root type:

apachectl start

You can also start httpd using /sbin/service httpd start. This starts httpd but does not set the environment variables. If you are using the default Listen directive in httpd.conf, which is port 80, you will need to have root privileges to start the apache server.

To stop the server, as root type:

apachectl stop

You can also stop httpd using /sbin/service httpd stop. The restart option is a shorthand way of stopping and then starting the Apache HTTP Server.

You can restart the server as root by typing:

apachectl restart 
or:
/sbin/service httpd restart

Apache will display a message on the console or in the ErrorLog if it encounters an error while starting.

By default, the httpd service does not start automatically at boot time. If you would wish to have Apache startup at boot time, you will need to add a call to apachectl in your startup files within the rc.N directory. A typical file used is rc.local. As this starts Apache as root, it is recommended to properly configure your security and authentication before adding this call.

You can also configure the httpd service to start up at boot time, using an initscript utility, such as /sbin/chkconfig, /usr/sbin/ntsysv, or the Services Configuration Tool program.

You can also display the status of your httpd server by typing:

apachectl status

The status module mod_status however needs to be enabled in your httpd.conf configuration file for this to work. For more details on mod_status can be found on http://httpd.apache.org/docs/2.2/mod/mod_status.html.

How to Start/Stop or Restart Apache server on CENTOS Linux server ?

How to Start/Stop or Restart Apache server on CENTOS Linux server ?

Apache is the HTTP server which is freely available over internet. It is a kind of software or program which is developed to run on Linux/Unix but now it is also work under systems like windows or MAC. Today’s most of the websites hosted under different servers like Linux, Windows, Java etc . But if you are hosted under Apache server and you need to makes changes in httpd.conf file or other configuration file then you have to restart Apache server so the changes may reflect.

If you are thinking how to restart Apache server through command line then don’t you worry here is the way…

To start your Apache server for Linux version 4.x/5.x/6.x or older commands :

## Start ##

# service httpd start

## Stop ##

# service httpd stop

## Restart ##

# service httpd restart

To start your Apache server for Linux version Linux version 7.x or newer commands :

## Start command ##

# systemctl start httpd.service

## Stop command ##

# systemctl stop httpd.service

## Restart command ##

# systemctl restart httpd.service