Jump to content

[SOLVED] How to get variable value on next page


raj86

Recommended Posts

Hello friends

                i am working on payentry page ..there i have this code.........

 

$str="select MAX(PSRN) from paymajor";
$result=mysql_query($str) or die(mysql_error());
while($row=mysql_fetch_assoc($result))
{
$psrn=$row['MAX(PSRN)']+1;
}

 

i need to print $psrn value in the success page......for that i am using

header ('Location: http://localhost/bitssap/success.php');

 

but after success its showing this meassage

Data entered successfully. The PSRN generated is $psrn

 

i am not able to print the value of psrn on success page

can anybody suggest me how to do this...

 

payentry page

$str="select MAX(PSRN) from paymajor";
$result=mysql_query($str) or die(mysql_error());
while($row=mysql_fetch_assoc($result))
{
$psrn=$row['MAX(PSRN)']+1;
}

$query = "INSERT INTO `paymajor` .........
$result = mysql_query($query)  or die ("Error in query: $query");
if($result)
{
header ('Location: http://localhost/bitssap/success.php?psrn=' .$psrn);
}

 

success page

 

<?php
session_start();
$psrn = $_GET['psrn'];
?>

<html>
<head>
<title>Success</title>
</head>
<hr style="color:#33FF00">
<center>
<h1 style="color:#000099">Data entered successfully. The PSRN generated is $psrn</h1>

</head>

<body bgcolor="#CCCCCC">
<input type="button" name="submit2" value="Pay Entry" onclick='window.location="http://localhost/bitssap/payentry.php"' />
<input type="button" name="submit2" value="Main Menu" onclick='window.location="http://localhost/bitssap/index.php"' />
</center>
</body>
</html>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.