I try to send value form one page to ano ther page but it not work PHP

The code be low i trey to send value form one page to another page but it not work what wrong with it
<?php require_once('../Connections/village.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
 
  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
 
  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}
 
 
$AccNo = $_POST['AccNo'];
 
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
 
  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
 
  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}
 
mysql_select_db($database_village, $village);
$query_rec_borrowpay = "SELECT balanceborow.wid, balanceborow.wname, balanceborow.amout,  CEILING(balanceborow.amout*.02) AS Interrest, balanceborow.DateBalance, balanceborow.amout, Round(DATEDIFF( NOW() , balanceborow.DateBalance)/30, 0) As MonthNos, (Round(DATEDIFF( NOW() , balanceborow.DateBalance)/30, 0)*2-1)*CEILING(balanceborow.amout*.02) As MiniPay FROM balanceborow WHERE balanceborow.wid ='$AccNo'   ";
$rec_borrowpay = mysql_query($query_rec_borrowpay, $village) or die(mysql_error());
$row_rec_borrowpay = mysql_fetch_assoc($rec_borrowpay);
$totalRows_rec_borrowpay = mysql_num_rows($rec_borrowpay);
 
mysql_select_db($database_village, $village);
mysql_db_query($database_village,"SET NAMES tis620"); 
$query_Recordset1 = "SELECT listname.ID, listname.Name FROM listname WHERE listname.ID = '$AccNo' ";
$Recordset1 = mysql_query($query_Recordset1, $village) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=tis-620" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style1 {
	font-size: xx-large;
	color: #000066;
}
-->
</style>
<script src="../SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<link href="../SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
</head>
 
<body>
<form id="form1" name="form1" method="post" action="Village_paymentProcessing.php">
  <label></label>
  <h1>
    <label></label>
  </h1>
  <table width="531" height="189" border="1">
    <tr>
      <td width="167" height="47">ACCOUNT NO</td>
      <td width="348"><?php echo $row_rec_borrowpay['wid']; ?></td>
    </tr>
    <tr>
      <td height="49">ACCOUNT NAME</td>
      <td><?php echo $row_rec_borrowpay['wname']; ?></td>
    </tr>
    <tr>
      <td height="49">Interrest</td>
      <td><?php echo $row_rec_borrowpay['Interrest']; ?></td>
    </tr>
    <tr>
      <td height="49">Bowrow Amount</td>
      <td><?php echo $row_rec_borrowpay['amout']; ?> baht Date <?php echo $row_rec_borrowpay['DateBalance']; ?></td>
    </tr>
    <tr>
      <td height="49">No of month</td>
      <td><?php echo $row_rec_borrowpay['MonthNos']; ?></td>
    </tr>
    <tr>
      <td height="49">Minimum Payment</td>
      <td><h1 class="style1"><?php echo $row_rec_borrowpay['MiniPay']; ?></h1></td>
    </tr>
    <tr>
      <td>BAHT </td>
      <td><span id="sprytextfield1">
      <input name="payment" type="text" class="style1" id="textfield" />
      <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><label>
        <input type="submit" name="button" id="button" value="Submit" />      
        <input name="AccNo" type="hidden" value="<?php echo $row_rec_borrowpay['wid']; ?>" />
        <input name="MinimumPay" type="hidden" value="<?php echo $row_rec_borrowpay['MiniPay']; ?>" />
         <input name="NoOfMonth" type="hidden" value=" <?php echo $row_rec_borrowpay['MonthNos']; ?>" />
            <input name="Interrest" type="hidden" value=" <?php echo $row_rec_borrowpay['Interrest']; ?>" />
          <input name="Cancel" type="button" id="button2" value="cancel" onClick="history.go(-1)" />
      </label></td>
    </tr>
  </table>
  <p>&nbsp;</p>
  <label></label>
</form>
<script type="text/javascript">
<!--
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "integer", {validateOn:["change"]});
//-->
</script>
</body>
</html>
<?php
mysql_free_result($rec_borrowpay);
 
mysql_free_result($Recordset1);
?>
 
 
 
 
***********************************
 
Village_paymentProcessing.php
**********************************
 
 
 
<?php 
 
$AccNo = $_POST['AccNo'];
$MinimumPay = $_POST['MinimumPay'];
$payment = $_POST['payment'];
$NoOfMonth = $_POST['NoOfMonth'];
$Interrest = $_POST['Interrest'];
 
echo " $AccNo  $MinimumPay   $payment   " ;
 
?>

Open in new window

teeraAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AlexSoftware EngineerCommented:
when you say that it is not work what do you mean exactly?
For example when you echo the post vars nothing print?
Because if you mean this you make a mistake in the echo...

$AccNo = $_POST['AccNo'];
$MinimumPay = $_POST['MinimumPay'];
$payment = $_POST['payment'];
$NoOfMonth = $_POST['NoOfMonth'];
$Interrest = $_POST['Interrest'];
 
echo " $AccNo  $MinimumPay   $payment   " ;  <--- you can not put quotes around the php variables...

echo $AccNo;
echo "<br>";

echo $$MinimumPay;
echo "<br>";

echo $payment   ;
echo "<br>";

change the echo.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cornelia YoderArtistCommented:
@alex_code:   >>>>>echo " $AccNo  $MinimumPay   $payment   " ;  <--- you can not put quotes around the php variables...

Sure you can, I do it all the time.
0
AlexSoftware EngineerCommented:
echo $AccNo;
echo "<br>";

echo $$MinimumPay; <-- sory i put by accident a  more... remove it
echo "<br>";

echo $payment;
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

AlexSoftware EngineerCommented:
yes you can but only if you open a tag <? inside of the quotes.Try to change the echo as i said and tell me if something changes...
0
Cornelia YoderArtistCommented:
Alex, the most common echo I use is

echo "varname=$varname<br>";  

It works just fine, that's NOT his problem.
0
AlexSoftware EngineerCommented:
ok i agree with you but i said it for security reasons to be sure that if the variable is not empty to echo something.

Ok let's see where is the problem

i try this:I put static text into the hiddens text fields,echo the data contais and it is working properly.I think that the vars of the database table you select comes empty.

All those If your problem is that nothing echo.You didn't tell me what kind of error you get.You get any warning?
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=tis-620" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style1 {
        font-size: xx-large;
        color: #000066;
}
-->
</style>
<script src="../SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<link href="../SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
</head>
 
<body>
<form id="form1" name="form1" method="post" action="Village_paymentProcessing.php">
  <label></label>
  <h1>
    <label></label>
  </h1>
  <table width="531" height="189" border="1">
    <tr>
      <td width="167" height="47">ACCOUNT NO</td>
      <td width="348"><?php echo $row_rec_borrowpay['wid']; ?></td>
    </tr>
    <tr>
      <td height="49">ACCOUNT NAME</td>
      <td><?php echo $row_rec_borrowpay['wname']; ?></td>
    </tr>
    <tr>
      <td height="49">Interrest</td>
      <td><?php echo $row_rec_borrowpay['Interrest']; ?></td>
    </tr>
    <tr>
      <td height="49">Bowrow Amount</td>
      <td><?php echo $row_rec_borrowpay['amout']; ?> baht Date <?php echo $row_rec_borrowpay['DateBalance']; ?></td>
    </tr>
    <tr>
      <td height="49">No of month</td>
      <td><?php echo $row_rec_borrowpay['MonthNos']; ?></td>
    </tr>
    <tr>
      <td height="49">Minimum Payment</td>
      <td><h1 class="style1"><?php echo $row_rec_borrowpay['MiniPay']; ?></h1></td>
    </tr>
    <tr>
      <td>BAHT </td>
      <td><span id="sprytextfield1">
      <input name="payment" type="text" class="style1" id="textfield" />
      <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><label>
        <input type="submit" name="button" id="button" value="Submit" />
        <input name="AccNo" type="hidden" value="gfhhgfh" />
        <input name="MinimumPay" type="hidden" value="gfhfgh" />
         <input name="NoOfMonth" type="hidden" value="fghfghfg" />
            <input name="Interrest" type="hidden" value="fghfghfh" />
          <input name="Cancel" type="button" id="button2" value="cancel" onClick="history.go(-1)" />
      </label></td>
    </tr>
  </table>
  <p>&nbsp;</p>
  <label></label>
</form>
<script type="text/javascript">
<!--
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "integer", {validateOn:["change"]});
//-->
</script>
</body>
</html>
 
 
Village_paymentProcessing.php
**********************************
 
 
 
<?php 
 
$AccNo = $_POST['AccNo'];
$MinimumPay = $_POST['MinimumPay'];
$payment = $_POST['payment'];
$NoOfMonth = $_POST['NoOfMonth'];
$Interrest = $_POST['Interrest'];
 
echo " $AccNo  $MinimumPay   $payment   " ;
 
?>

Open in new window

0
teeraAuthor Commented:
It still nothing print  Does It have more thing not correct in my code


<?php

$AccNo = $_POST['AccNo'];
$MinimumPay = $_POST['MinimumPay'];
$payment = $_POST['payment'];
$NoOfMonth = $_POST['NoOfMonth'];
$Interrest = $_POST['Interrest'];

echo $AccNo;
echo "<br>";

echo $MinimumPay;
echo "<br>";

echo $payment   ;
echo "<br>";

?>
0
AlexSoftware EngineerCommented:
As i see to your code you don't use any extract data with a while statement.How do you get the table data?
0
teeraAuthor Commented:
That page can get data form database I capture  picture when I run it
ask.JPG
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.