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 Link to comment https://forums.phpfreaks.com/topic/182681-send-_post-and-_get/ 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> Link to comment https://forums.phpfreaks.com/topic/182681-send-_post-and-_get/#findComment-964202 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' Link to comment https://forums.phpfreaks.com/topic/182681-send-_post-and-_get/#findComment-964248 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. Link to comment https://forums.phpfreaks.com/topic/182681-send-_post-and-_get/#findComment-964252 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. Link to comment https://forums.phpfreaks.com/topic/182681-send-_post-and-_get/#findComment-964266 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.