ayok Posted November 23, 2009 Share Posted November 23, 2009 Hello.. I've got a question. I'm trying to send both variables $_POST and $_GET, but it's not happened. Is it possible to do that? Here is my try: <form action='' name="postget' method='post' style='display: none;'> <input type='text' name='posttxt' value='myPostVariable' /><a href='?gettxt=myGetVariable' onclick='document.postget.submit();'>Send Double vars</a> So far, it doesn't send any variable. So, is it possible to send get and post in one click? If yes, would anybody tell me how? Thanks in advanced, ayok Quote Link to comment Share on other sites More sharing options...
taquitosensei Posted November 23, 2009 Share Posted November 23, 2009 do hidden forms for your get variables then pass those in the post example yoururl.com?field1=blah <form action='' method='post'> <?php foreach($_GET as $k=>$v) { echo "<input type='hidden' name='".$k."' value='".$v."'>"; } </form> Quote Link to comment Share on other sites More sharing options...
ayok Posted November 23, 2009 Author Share Posted November 23, 2009 Hi sensei, I think that would change the get variables into post when it's sent. What I need to do is sending get and post. So the url from my example will be, ?gettxt=myGetVariable and also send posttxt with value 'myPostVariable' Quote Link to comment Share on other sites More sharing options...
taquitosensei Posted November 23, 2009 Share Posted November 23, 2009 as far as I know you're either getting or posting. Not both. So you'd have to adjust the receiving page to use POST instead of get. Quote Link to comment Share on other sites More sharing options...
ayok Posted November 23, 2009 Author Share Posted November 23, 2009 I see.. Ok, thank you. I think I know enough. 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.