i need to links to php pages together but i dont noe how thats my code
for first page
second page
plz help
thanks
for first page
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Prac 3 Task 4</title>
</head>
<body>
<?php
$conn = odbc_connect("warehouse","IWSDStudent","assign2");
$sql = "SELECT customerID,firstName, lastName FROM customer ";
$rs = odbc_exec($conn,$sql);
?>
<table border="1" summary="product Details">
<tr>
<th>customer ID</th>
<th>First Name</th>
<th>Last Name </th>
</tr>
<?php
while (odbc_fetch_row($rs))
{
$fName = odbc_result($rs,"firstName");
$lName = odbc_result($rs, "lastName");
$cusID = odbc_result($rs,"customerID");
echo "<td> $cusID</td>"
echo "<tr><td> <a href='task10.php'>$fName </a></td>";
echo "<td> $lName</td></tr>";
}
odbc_close($conn);
?>
</table>
</body>
</html>
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Task 10 PHP</title>
</head>
<body>
<table border="1" summary="product Details">
<tr>
<th>Order NO</th>
<th>Order date </th>
<th>Shipped</th>
</tr>
<?php
$cusID = $_GET["custID"];
$conn = odbc_connect("warehouse","IWSDStudent","assign2");
$sql= "SELECT orderNumber, orderDate,shipped FROM orders WHERE customerID= '$cusID'";
$rs = odbc_exec($conn,$sql);
if ($rs) { // Got some data?
while (odbc_fetch_row($rs))
{
$orderNo = odbc_result($rs,"orderNumber");
$orderdate = odbc_result($rs, "orderDate");
$shipped = odbc_result($rs,"shipped");
echo "<tr><td>$orderNo</td>";
echo "<td> $orderdate</td>";
echo "<td> $shipped</td></tr>";
}
}
else {
// Display an error message if no data was retrieved or some other error condition was encountered.
print "<p>There's no values for the customer id please try again: $cusID.</p>";
print "<p><a href=\"task10.htm\">Return to try another number.</a></p>";
}
odbc_close($conn);
?>
</body>
</html>
thanks
Comment