Computer Science, asked by meamaanasif1234, 1 month ago

Create a html form to find the railway fare from one place to another.

Answers

Answered by poonammishra148218
0

Answer:

In the PHP script, the fare is calculated based on the source and destination stations, and the class of travel selected by the user. The calculated fare is then displayed to the user.

Explanation:

Here's an example of an HTML form to find the railway fare from one place to another:

<!DOCTYPE html>

<html>

<head>

<title>Railway Fare Calculator</title>

</head>

<body>

<h2>Railway Fare Calculator</h2>

<form action="calculate.php" method="post">

<label for="from">From:</label>

<input type="text" id="from" name="from"><br><br>

<label for="to">To:</label>

<input type="text" id="to" name="to"><br><br>

<label for="class">Class:</label>

<select id="class" name="class">

<option value="1A">1A</option>

<option value="2A">2A</option>

<option value="3A">3A</option>

<option value="SL">Sleeper</option>

<option value="CC">Chair Car</option>

<option value="2S">Second Seating</option>

</select><br><br>

<input type="submit" value="Calculate Fare">

</form>

</body>

</html>

In this form, the user enters the source and destination stations in the "From" and "To" fields, respectively. The user also selects the class of travel from the dropdown menu. When the user clicks on the "Calculate Fare" button, the form data is submitted to a PHP script called "calculate.php" for processing.

In the PHP script, the fare is calculated based on the source and destination stations, and the class of travel selected by the user. The calculated fare is then displayed to the user.

To learn more about similar question visit:

https://brainly.in/question/19961558?referrer=searchResults

https://brainly.in/question/35082910?referrer=searchResults

#SPJ1

Similar questions