-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
37 lines (36 loc) · 1.13 KB
/
index.php
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
<!doctype html>
<html>
<header>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</header>
<body>
<img src="http://www.oocities.org/azn_sarcasm/quotes_banner.jpg">
<h1>
<form name="input" method="post" action="aqui.php">
Enter name of the author for Quotes: <input type="text" name="Autor"> <input type="submit" value="submit">
</form>
</h1>
<?php
if(isset($_POST['Autor']))
{
$DB = "Quotes";
$aq = "ada.uprrp.edu";
$au = "githubtest";
$ap = "gitHub1.";
$localhost = mysql_pconnect($aq, $au, $ap);
if(!mysql_select_db($DB))
echo 'Could not select database: ' . mysql_error()."<br>";
$query = "SELECT UID, Name, QID, Quote FROM Author NATURAL JOIN Quote Where Name = '$_POST[Autor]'";
$result = mysql_query($query) or die(mysql_error());
echo "<table border='1' align='center'>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['Quote'] . "<br>" . "-". $row['Name']. "</td>";
echo "</tr>";
}
echo "</table>";
}
?>
</body>
</html>