-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRailEnquiry.php
More file actions
78 lines (70 loc) · 2.01 KB
/
RailEnquiry.php
File metadata and controls
78 lines (70 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<!-- PHP File for displaying the tables -->
<?php
try
{
$dbuser = 'group_21';
$dbpass = '885-479-849';
$dbhost = '10.17.50.126';
$dbname='group_21';
$conn = new PDO("pgsql:host=$dbhost;dbname=$dbname", $dbuser, $dbpass);
//echo "Connected\n";
}
catch (PDOException $e)
{
echo "Error : " . $e->getMessage() . "<br/>";
die();
}
$query1 ="select new_emp10(107,2)";
$statement=$conn->query($query1);
$row=$statement->fetch(PDO::FETCH_ASSOC);
/*$display = " <table border=\"1\">\n";
while (($row = $statement->fetch(PDO::FETCH_ASSOC))) {
$display .= " <tr>\n";
$display .= " <td>" . $row["train_code"] . "</td>\n";
$display .= " <td>" . $row["train_name"] . "</td>\n";
$display .= " <td>" . $row["source_station_code"] . "</td>\n";
//$display .= " <td>" . $row["destination_station_code"] . "</td>\n"
$display .= " </tr>\n";
}
echo $display;*/
var_dump($row);
/* $conn =new PDO('psql:host=10.17.50.126;dbname=group_21','group_21','885-479-849');
if(!$conn)
{
echo pg_last_error();
}
*/
/*$conn->select_db('krc353_2');
$table = $_GET["table"];
$name_q = $conn->query("SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = 'krc353_2' AND TABLE_NAME = '$table'");
while($row = $name_q->fetch_assoc()){
$name_col[] = $row;
}
$col_names = array_column($name_col, 'COLUMN_NAME');*/
?>
<html>
<head>
<title> Indian Railway Information </title>
<style>
body
{
text-align: center;
}
</style>
</head>
<body>
<br>
<form action="./RailEnquiry.php" method="POST">
Enter Train Name:
<input type="text" name="file_name" id="fileToUpload" required="required">
<input type="submit" value="Submit" name="submit">
</form>
<div>
<br>
Click on the Information you want to Search.<br><br>
<a href="./station.php"> Search station </a><br>
<a href="./Booking.php">Book a Train </a><br>
<a href="http://www.indianrail.gov.in/enquiry/PNR/PnrEnquiry.html?locale=en"> PNR enquiry </a><br>
</div>
</body>
</html>