raj86 Posted October 28, 2009 Share Posted October 28, 2009 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... Quote Link to comment Share on other sites More sharing options...
joel24 Posted October 28, 2009 Share Posted October 28, 2009 are you passing the $psrn with a session or through the URL? i.e. header ('Location: http://localhost/bitssap/success.php?psrn=' .$psrn); then on the success page $psrn = $_GET['psrn']; Quote Link to comment Share on other sites More sharing options...
raj86 Posted October 28, 2009 Author Share Posted October 28, 2009 how to use it through URL....I HAVE CUT AND PASTE YOUR CODE but its not working for me Quote Link to comment Share on other sites More sharing options...
joel24 Posted October 28, 2009 Share Posted October 28, 2009 can you show me the code of both pages? Quote Link to comment Share on other sites More sharing options...
raj86 Posted October 28, 2009 Author Share Posted October 28, 2009 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> Quote Link to comment Share on other sites More sharing options...
tastro Posted October 28, 2009 Share Posted October 28, 2009 just echo $psrn on the success page. now that you have send it via url already. header ('Location: http://localhost/bitssap/success.php?psrn=' .$psrn); Quote Link to comment Share on other sites More sharing options...
raj86 Posted October 28, 2009 Author Share Posted October 28, 2009 thanks its working Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.