Wednesday, 18 May 2016

How to create contact us form


Contact.php
index.html

Tuesday, 7 April 2015

simple registration form with MySql Connection


create reg.php


create index.php



create connect.php


Functions in PHP




output

another example




output


Monday, 6 April 2015

basic of php

Some Basic Information about PHP

  • PHP is an open-source server-side scripting language.You can create dynamic web pages with the PHP scripting language. A dynamic Web page interacts with the user, so that each user visiting the page sees customized information. PHP can also be used to create dynamic web pages that are generated from information accessed from a MySQL database. You can embed PHP commands within a standard HTML page.
  • PHP offers is connectivity to most of the common databases.it also offers integration with various external libraries.

Server-side scripting

  • Server-side scripting is a technique used in web development 
  • which involves employing scripts on a web server which produce a 
  • response customized for each user's (client's) request to the website.
  • The alternative is for the web server itself to deliver a static web page.
  • Scripts can be written in any of a number of server-side scripting languages.
  • Server-side scripting is distinguished from client-side scripting where embedded scripts,
  • such as JavaScript, are run client-side in a web browser, 
  • but both techniques are often used together.
  • Server-side scripting is often used to provide a customized interface for the user.



  • How to Save Your PHP Pages
              with .php extension

  • Example Simple HTML & PHP Page


Display Hello world



PHP - Variables

$variable_name = Value;


Example

Outputting a String


another example



PHP - Strings



PHP - String with Single Quotes



PHP - Operators


• Assignment Operators
• Arithmetic Operators
• Comparison Operators
• String Operators
• Combination Arithmetic & Assignment Operators

The Include Function



save this file as course.php

now you can call this file in other file also:- using below example:-


The If Else Statement



start programming


file save as index.html



file save as main.php



now run the index.html file and feed the input field


basics of php

For PHP you need software : 
  • Text Editor - Notepad/Notepad++ will do. This will serve as our coding environment.
  • WAMP - This will be our web server. This is were we will be saving our website files and save our data to the database. 
  • Web Browser - You can use any browser.
What is php?
  • PHP is known as a server-sided scripting language.
  • PHP stands for is "Hypertext Pre-processor".
  • php is use to make dynamic and interactive Web pages.

Simple php script:-




Syntax:
PHP script starts with <?php and ends with ?>

Comments:
 // This is a single-line comment

# This is a single-line comment

/*
This is a
multiple-lines
comment
*/


Declaring PHP variable:


  • A variable starts with the $ sign
  • echo is use to print the value

 <?php
$txt = "hi";
$n = 20.00;
echo $hi;
echo $n;
?>

how to install wamp server

  • first  download wamp server as per your operating system like 32bit/64bit.
  •  after download follow the screenshot..
 
After finishing the installation., start wamp server you will see three colors of icon.








Red:WampServer red icon is showing that WampServer is Offline and no service has been started yet i.e Apache, PHP and MySql.

Yellow:WampServer red icon is show that WampServer is still Offline and any service among Apache, PHP and MySql has been failed to start.

Green:WampServer is working normal along with all services and your development server is ready to use.

when server is start go to browser and type localhost/phpmyadmin or localhost:8080/phpmyadmin
you will see page like this.
now you can see all options in this window like database,sql,etc....
for creating database click on database and you will get window like this...
then write database name and click on create .
using import option you can import the table .