HomeFAQSearchMemberlistRegisterLog in

Share | 
 

 PHP Basics- PART-1

View previous topic View next topic Go down 
AuthorMessage
aishu.moorthy
Newbie
Newbie


Posts : 12
Points : 28
Join date : 2009-07-27

PostSubject: PHP Basics- PART-1   Sat Aug 01, 2009 12:11 pm

Php basics-part 1
PHP – Hypertext Preprocessor


Why php?
1.PHP is a Platform Independent language.
2. PHP does not follow the OOP paradigm entirely. It only supports partial encapsulation, and partial polymorphism.
3. PHP is recommended because it is highly reliable, secure and fast than ASP.


Advantages of PHP:
-> PHP is one of the most popular server side scripting languages running today.
-> PHP is used for creating dynamic webpages that interact with the user offering customized information.
-> PHP run very fast, secure. Easy to understand


Syntax for a basic PHP Script:
<?php and ends with ?>.
<?php
Statements;
.
.
.
?>

A PHP file normally contains HTML tags, just like an HTML file, and some PHP scripting code.

<html>
<body>
<?php
Statements;
.
.
?>
</body>
</html>

POST METHOD:
 If you use “POST” method in HTML file,
you must use “POST” in PHP file.
REQUEST METHOD:
 If you use “GET” or “POST” in HTML file,
you can use “REQUEST” in PHP file.

A simple example which u can work out.

1.Basic instructions before that...

1.Install either LAMP Server or WAMP server.
2.These two are available for free.
3.Then go to START->Wampserver->StartWampServer
4.After that save the html and php files in C:(or location where wamp is installed)/wamp/www/
5.This is how to run the program.

Steps to create the simple code n to run it.
1.Open the note pad, type the following, then save it as form1.html in wamp/www/html

EXAMPLE:
Form1.html
<html>
<head><title>FORM1</title></head>
<body>
<form action=“form1.php” method=“get”>
Name: &nbsp&nbsp<input type=“text” name=“un”>
<br><br>
Password: &nbsp&nbsp<input type=“password” name=“pw”>
<br><br>
<input type=“submit” value=“Enter”>
</body>
</html>


2.Then type the following separately n save it as form1.php in wamp/www/html
Form1.php
<?php
echo $_GET[“un”].”<br>”;
echo $_GET[“pw”].”<br>”;
?>


To run this

Step 1: Open the server home page…
and give http://localhost/filename.html
ex: http://localhost/form1.html
Then,

Name: ABCD
Password:efgh
Step 2: After you click submit button you will get the following output…
ABCD
efgh.


Last edited by aishu.moorthy on Sun Aug 02, 2009 11:49 am; edited 1 time in total
Back to top Go down
View user profile
mathes
Moderator
Moderator
avatar

Posts : 29
Points : 43
Join date : 2009-07-30
Age : 28
Location : Halwa city

PostSubject: Re: PHP Basics- PART-1   Sat Aug 01, 2009 8:23 pm

Aishu..

Thnx for the post.. and can u be a bit clear with your examples.. Like... Step by step..
Back to top Go down
View user profile http://itcians.subjectdebate.com
Arvind
Administrator
Administrator
avatar

Posts : 132
Points : 266
Join date : 2009-06-16
Location : Still exploring where i am.....

PostSubject: Re: PHP Basics- PART-1   Sat Aug 01, 2009 8:34 pm

Yeah your right mathes, Smile

Aishu...Can you be little clear and post in step by step tutorial, because it would be useful for others to read right........ Wink
Back to top Go down
View user profile http://infinitude.nsguru.com
aishu.moorthy
Newbie
Newbie


Posts : 12
Points : 28
Join date : 2009-07-27

PostSubject: Thanks for ur comments   Sun Aug 02, 2009 11:52 am

hi thanks for ur comments...Very Happy
but i'm not clear about wat changes u r telling to make... Question
but i've made some changes...
just tell me wat changes to make further





With regards,
Aishwarya.M.B Very Happy
Back to top Go down
View user profile
Arvind
Administrator
Administrator
avatar

Posts : 132
Points : 266
Join date : 2009-06-16
Location : Still exploring where i am.....

PostSubject: Re: PHP Basics- PART-1   Sun Aug 02, 2009 12:00 pm

Hi aish,

Ok I think you can look into my version of HTML tutorial to get some idea here is the link to first post BASICS OF HTML. Wink




-Arvind
Back to top Go down
View user profile http://infinitude.nsguru.com
Sponsored content




PostSubject: Re: PHP Basics- PART-1   

Back to top Go down
 
PHP Basics- PART-1
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» I know the volcano story is becoming part of history.
» What's your favorite part of the newspaper?
» Movie Hmoob : Vaj Tuam Thawj Part 1.1
» What are the basic requirements for using Selenium IDE?
» Fechtbüch - By Antonio Castigliano

Permissions in this forum:You cannot reply to topics in this forum
 :: ALL ABOUT COMPUTER SCIENCE :: INFINITUDE PROGRAMMING SCHOOL-
Jump to: