Would you like to react to this message? Create an account in a few clicks or log in to continue.



 
HomeSearchLatest imagesRegisterLog in

 

 PHP Basics- PART-1

Go down 
3 posters
AuthorMessage
aishu.moorthy
Newbie
Newbie



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

PHP Basics- PART-1 Empty
PostSubject: PHP Basics- PART-1   PHP Basics- PART-1 I_icon_minitimeSat 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
mathes
Moderator
Moderator
mathes


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

PHP Basics- PART-1 Empty
PostSubject: Re: PHP Basics- PART-1   PHP Basics- PART-1 I_icon_minitimeSat 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
http://itcians.subjectdebate.com
Arvind
Administrator
Administrator
Arvind


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

PHP Basics- PART-1 Empty
PostSubject: Re: PHP Basics- PART-1   PHP Basics- PART-1 I_icon_minitimeSat 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
https://infinitude.forumotion.com
aishu.moorthy
Newbie
Newbie



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

PHP Basics- PART-1 Empty
PostSubject: Thanks for ur comments   PHP Basics- PART-1 I_icon_minitimeSun 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
Arvind
Administrator
Administrator
Arvind


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

PHP Basics- PART-1 Empty
PostSubject: Re: PHP Basics- PART-1   PHP Basics- PART-1 I_icon_minitimeSun 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
https://infinitude.forumotion.com
Sponsored content





PHP Basics- PART-1 Empty
PostSubject: Re: PHP Basics- PART-1   PHP Basics- PART-1 I_icon_minitime

Back to top Go down
 
PHP Basics- PART-1
Back to top 
Page 1 of 1
 Similar topics
-
» HTML TUTORIAL PART 1 : BASICS OF HTML
» HTML TUTORIAL PART 2 : CREATING YOUR FIRST WEBPAGE
» HTML TUTORIAL PART 9: EXPLANATION OF TABLES AND STYLES TAG
» HTML TUTORIAL PART 4 : EXPLANATION OF BASIC TAGS
» UNIX TUTORIAL PART-1: INTRODUCTION TO UNIX OPERATING SYSTEM

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