Showing posts with label web server. Show all posts
Showing posts with label web server. Show all posts

Thursday 9 April 2015

Submitting and Retrieving Forms data using PHP

Web forms are GUI element wherein the data to be processed is submitted to the web server. The whole process is called client/server data processing model. It is applicable in web sites and web applications. Web form contains text boxes, buttons, check boxes, which allows the user to enter the required information. Web form contains a submit button, when you clicked the submit button, the contents of the form is submitted to the server for processing.
Form is formed using <form> tag which having attributes like action, method, enctype and name. All attributes having their own functions, for example enctype is used for making encryption for form contents.

Submitting the form data

The data of the form cab be sent to the server using either the post() or get() method. The get() method having  attribute method equal to get() and post method having attribute method equal to post().
For example : <form name ="amar" method ="get" action="amar.php">.
Note : In post method information submitted by the user don't show whereas in get information entered by the user Shows in url.

Retrieving Form data

The form data retrieve using php file(amar.php. You must have a web server like apache or wampserver and the both HTML and PHP files should be in same directory(root directory) of the server. The server is used for transmitting data and retrieving data. Lei's see how we can do it.
First make a form in HTML file.
<html>
<head>
<title>Data transmission</title>
</head>
<body>
<form name="amar" method="get" action="amar.php">
First name:
<input type="text" name="first" />
</br>
Last name:
<input type="text" name="last" />
</br>
<input type="submit" value="submit" name="button">
</body>
</html>

 

Now retrieve data using these lines.

<html>
<head>
<title>retrieving data</title>
</head>
<body>
first name is :
<?php
echo $_GET["first"];
?>
</br>
last name is :
<?php
echo $_GET["last"];
?>
</body>
</html>


It's all about HTML and PHP form data transmission.In next article we will focus on Database connection using PHP.

 

How to install Apache Tomcat on windows

Today i explain here about tomcat 8.0 installation in windows 7.
 
Step 1)   Firstly we download java jdk(java development kit) on system
                     from official website of Oracle corporation.
                     after installing JDK we should define JAVA_HOME variable
                in system environmental variables.JAVA_HOME should be
                write as the directory path of java installation folder.  

Step 2)   After that we must define JRE_HOME variable also in system
               environmental variables.
               JRE_HOME = C:\program files\java\jre (as default)      
               It is that most important variable for running tomcat because 
               Catlina intracts with JRE for startup.

Step 3)   Now download Apache Tomcat from official website.

Step 4)   Install it in system drive like C:\ as default.

Step 5)   Start tomcat server in cmd using following command :
               %CATALINA_HOME%\bin\startup.bat 

Step 6)   Open the browser and type localhost:8080 .If you see the
               tomcat official window then it was install successfully.

In above image i changed my port to 5484.

              For any problem contact me using contact us tab or comment 
              here.