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...

 

Link to comment
Share on other sites

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>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.