i need to links to php pages together but i dont noe how thats my code
for first page - <?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>
second page -
<?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>
plz help
thanks
6 9035
what do you mean by linking them together?
btw use code tags, it makes things so much easier to read :)
EDIT nvm, i think i know what you mean by linking them. if you want to send $_GET[] variable, you need to put the variable in your url. -
http://www.my-domain.org/my-page.php?myFirstVariable=aValue&mySecondVariable=2
-
then, you can get the variables with $_GET
example: - echo $_GET['myFirstVariable'];
-
echo $_GET['mySecondVariable'];
this will result in
aValue2
Get Customer page - <?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");
-
$custID = odbc_result($rs,"customerID");
-
// pass the $cistID as a query string variable to the task10 page
-
echo "<td> <a href='task10.php?custID=$custID'>$cusID<a></td>"
-
echo "<tr><td> <a href='task10.php?custID=$custID'>$fName </a></td>";
-
echo "<td><a href='task10.php?custID=$custID'> $lName</a></td></tr>";
-
}
-
odbc_close($conn);
-
?>
-
</table>
-
</body>
-
</html>
page task10 - <?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
-
if (isset($_GET['custID'])){
-
$custID = $_GET["custID"];
-
}
-
$conn = odbc_connect("warehouse","IWSDStudent","assign2");
-
$sql= "SELECT orderNumber, orderDate,shipped FROM orders WHERE customerID= '$custID'";
-
$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>
read php $_post, $_get and $_request method
i dont know why doesnt work to check id entered is save in database is just return empty field but i want to say to customer click link below because u entered wrong id
<?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
that’s fine ... glad to help
and i solve the above problem too
thanks again
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Craig |
last post by:
Hi,
What I'm trying (quite poorly) to do is make it so when a link is clicked the
text inside a div or p changes.
I've tried numerous things, most of which work in IE but none of which work in...
|
by: Unregistered |
last post by:
I'm making an Intranet site for someone who is not very familiar wit
making websites, thus I would like to make it as simple as possible fo
her when she needs to update it.
The intranet site...
|
by: Xerxes |
last post by:
Hi,
how can I activate a login when someone clicks on a link? I want only
authorized users to have access to the pages accessible through the
links.
Thanks.
|
by: Tom Jordan |
last post by:
Hi all,
Ok, could do with some advice on this.
I've written a script in ASP for a client so they can compose HTML
newsletters and include various products from the online database.
I didn't...
|
by: Yeah |
last post by:
I have web document A which contains six links that all go to document B.
However, all hyperlinks must go to a different location within that document
(similar to anchors: A NAME= etc.).
How do...
|
by: Rhino |
last post by:
Yesterday, I reworked the index on my site - http://sfl.london.on.ca - so
that they used list markup and I'm quite pleased with them. However, I'm
having a problem with one small aspect of the menu...
|
by: Richard |
last post by:
Please hlep with a very frustrating problem. I need to be able to have a
reference to my "btcopyrights" CSS class override the link colors first
specified earlier in the CSS.
I inherited a large...
|
by: hestres |
last post by:
Hello,
I'm working on some link styles for this page:
http://www.house.gov/velazquez/lh0205tres/reports.html
I want all the links to always display in red (#CC0000), but in IE6
and 7 they...
|
by: ted |
last post by:
I have an old link that was widely distributed. I would now like to
put a link on that old
page that will go to a new page without displaying anything.
|
by: Keith G Hicks |
last post by:
I'm confused about how to code a link button to go to the page I need
(asp.net 2.0)
My root is "Website1"
Here's the layout for the purposes of this question:
Website1 (folder)...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
| |