Chelz Adams
Chelz Adams

Reputation: 731

Data Pass to another page

I have a html form to select a report type, when i select a report and press submit button, I can catch that passing value and I filter data from database, then I have to pass that filtered data to another page to print that report,

so how can i pass data to another page automatically. (page should option in _blank)

Upvotes: 0

Views: 142

Answers (2)

Manish Sharma
Manish Sharma

Reputation: 2426

in your .php page

<html>
<body>

<form action="other.php" method="post">
   Name: <input type="text" name="name">
   Email: <input type="text" name="email">
<input type="submit">
</form>

</body>
</html> 

other.php

<html>
<body>

  Hi <?php echo $_POST["name"]; ?>!<br>
  Your mail is <?php echo $_POST["mail"]; ?>.

</body>
</html> 

Upvotes: 1

Janak
Janak

Reputation: 5052

You can use the hidden fields to store the data. And submit the form explicitly to another page using :

 $('form#FormID').submit();

This will help you get the data on the next page. You can also use $_SESSION .

Upvotes: 1

Related Questions