Jump to content

post and get in the same submission


voyageurdumonde

Recommended Posts

Hello,

 

I like to send and reading variable with post and get. Is it possible?

 

I have do that but that doesn't work

<form id="test" action="test.php" method="post">
<input type="hidden" name="a_recup" value="variable_ici"/>
</form>
<a href='test.php?town=Montreal' onclick='document.getElementById("test").submit()'>link</a>
<a href='test.php?town=New_York' onclick='document.getElementById("test").submit()'>Link1</a>
<?php

$variable=$_POST['a_recup'];

echo $variable;

$ville=$_GET['town'];
echo $town;

?> 

 

Thanks for your help

Link to comment
https://forums.phpfreaks.com/topic/233996-post-and-get-in-the-same-submission/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.