script view_activity_firstpage.php
<?php
$page_title = 'View Customer Transaction';
if (isset($_POST['submit'])) { // Handle the form.
require_once ('./mysql_connect.php'); // Connect to the db.
// Create a function for escaping the data.
function escape_data ($data) {
global $dbc; // Need the connection.
if (ini_get('magic_quotes_gpc')) {
$data = stripslashes($data);
}
return mysql_real_escape_string($data, $dbc);
} // End of function.
$message = NULL; // Create an empty new variable.
// Check for a reference ID.
if (empty($_POST['token_id'])) {
$t = FALSE;
$message .= '<p>You forgot to enter your reference ID!</p>';
} else {
$t = escape_data($_POST['token_id']);
}
if ( $t ) { // If everything's OK.
session_start();
session_register('token_id');
$_SESSION['token_id'] = $t;
// Make sure the account number available.
$query = "SELECT * FROM customer_bank WHERE token_id = '$t' ";
$result = @mysql_query ($query);
if ($result) { // If it ran OK.
header ("Location: [url]http://[/url]" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/view_activity_next.php");
exit();
} else { // If it did not run OK.
// Send a message to the error log, if desired.
echo '<p><font color="red" size="+1">Your request cannot be processed. We apologize for any inconvenience.</font></p>';
}
mysql_close(); // Close the database connection.
} else { // If it did not run OK.
$message = '<p>Please try again.</p>';
}
} // End of the main Submit conditional.
// Print the error message if there is one.
if (isset($message)) {
echo '<font color="red">', $message, '</font>';
}
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>"method="post">
<fieldset><legend>Enter your information in the form below:</legend>
<p><b>Reference ID:</b> <input type="text" name="token_id" size="32" maxlength="32" value="<?php if (isset($_POST['token_id'])) echo $_POST['token_id']; ?>" /></p>
</fieldset>
<div align="center"><input type="submit" name="submit" value="Continue" /></div>
</form><!-- End of Form -->
<?php
include ('includes/footer_home.html');
?>
script view_activity_next.php
<?php
session_start();
include("db.php");
// Get a connection to the database
$cxn = @ConnectToDb($dbServer, $dbUser, $dbPass, $dbName);
$refID = $_SESSION['token_id'];
$sql = "SELECT * FROM customer_bank, view WHERE token_id = '$refID'";
$result = mysql_query($sql) or die;
?>
<html>
<head>
<title> Customer Transaction </title>
</head>
<body bgcolor="#ffffff">
<h1>Transaction Done</h1>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="30%" height="25" bgcolor="red">
<font face="verdana" size="1" color="white">
<b>Reference ID</b>
</font>
</td>
<td width="10%" height="25" bgcolor="red">
<font face="verdana" size="1" color="white">
<b>Acoount Number</b>
</font>
</td>
<td width="50%" height="25" bgcolor="red">
<font face="verdana" size="1" color="white">
<b>Balance</b>
</font>
</td>
</tr>
<?php
while($row = mysql_fetch_array($result))
{
?>
<tr>
<td width="30%" height="25">
<font face="verdana" size="1" color="black">
<?php echo $row["token_id"]; ?>
</font>
</td>
<td width="10%" height="25">
<font face="verdana" size="1" color="black">
$<?php echo $row["account_no"]; ?>
</font>
</td>
<td width="50%" height="25">
<font face="verdana" size="1" color="black">
<?php
$balance = $row["balance"];
$price = $row["price"];
$totalbalance = $balance - $price;
echo $totalbalance; ?>
</font>
</td>
</tr>
<tr>
<td width="100%" colspan="4">
<hr size="1" color="red" NOSHADE>
</td>
</tr>
<?php
}
?>
<tr>
<td width="100%" colspan="4">
<font face="verdana" size="1" color="black">
<a href="bank.php">Continue >></a>
</font>
</td>
</tr>
</table>
The problem is that when at view_activity_next it does not appear anything. A blank only. Please help me to solve this problem?