i was wondering if it is possible to pass a variable through POST. I need to pass an array to another document through post. I know that it is not possible to call PHP function through a button. I just want to cut down on the number of queries that i perform.
What i am trying to do is to creat a function that takes the page content and opens it in a new window w/o page nav so that it prints nice.
I could pass the artical ID to the other page, but that would require another MYSQL query. I can pass the text of the document through POST.
I am not sure what is better.
Thanks.
Hope that makes since but it is late and i am too lazy to re read it.
Passint variables through POST
Moderator: General Moderators
Not sure to get what you need but you could try the following as this is the method I use to pass variables from a page to another :
On your page1.php :
On page2.php :
Hope this helps...
On your page1.php :
Code: Select all
<FORM ACTION="page2.php" METHOD="post" ENCTYPE="x-www-form-urlencoded">
<input type="text" name="FIELD1">
<input type="submit" name="SUBMIT" value="Next">
</FORM>Code: Select all
<?php
echo "$FIELD1";
?>- gite_ashish
- Forum Contributor
- Posts: 118
- Joined: Sat Aug 31, 2002 11:38 am
- Location: India