surajkandukuri Posted October 19, 2009 Share Posted October 19, 2009 Hi, I am new to php, I have a table whose values are populated from database and What I want is User should be allowed to click these values(values populated from database) and I should redirect him to another page with values in the table and few more variable values. I was trying with post but there is no sucess. Please suggest me how to do this Quote Link to comment https://forums.phpfreaks.com/topic/178254-posting-values-to-a-new-page/ Share on other sites More sharing options...
surajkandukuri Posted October 19, 2009 Author Share Posted October 19, 2009 To be more precise what i want is Passing multiple values to a new php page via <a Href ="" tag> Quote Link to comment https://forums.phpfreaks.com/topic/178254-posting-values-to-a-new-page/#findComment-939857 Share on other sites More sharing options...
KevinM1 Posted October 19, 2009 Share Posted October 19, 2009 You simply need to put the filepath of the second page as the first page's form's action attribute, and grab a hold of the correct form inputs. Simple example: page1.html: <html> <head> <title>Something</title> </head> <body> <form name="myForm" action="page2.php" method="post"> Name: <input name="userName" type="text" /><br /> Password: <input name="userPass" type="password" /><br /> <input name="submit" type="submit" value="submit" /> </form> </body> </html> page2.php - <?php if(isset($_POST['submit'])) { $user = $_POST['userName']; $pass = $_POST['userPass']; //continue processing } else { //form wasn't submitted...handle this error } ?> Quote Link to comment https://forums.phpfreaks.com/topic/178254-posting-values-to-a-new-page/#findComment-939860 Share on other sites More sharing options...
surajkandukuri Posted October 19, 2009 Author Share Posted October 19, 2009 Thanks Nightslyr!! But My table looks like this <td> Position #1 </td> <td width="275"> <?php echo($emp_position[1]);?> <a href="temp.php">Click here for detail report</a></td> <td><?php echo($emp_startdates[1]);?></td> <td><?php echo($emp_enddates[1]);?></td> <td><?php echo($duration[1]);?></td> <td rowspan="6"><?php echo($totalwithrexam);?></td> </td> And I want to send the few values such as $emp_position[1] to "temp.php". Please suggest !! Quote Link to comment https://forums.phpfreaks.com/topic/178254-posting-values-to-a-new-page/#findComment-939865 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.