I have the code above at http://dot.kr/qna/221221_2buttons/
<form action="search.php" method="get">
<button type="submit">
<img src="http://load.dot.kr/dmg/search.png"
name="out" alt="innSearch" style="width:20px">
</button>
<input type="text" name="key" value="" class="mgnLR5" style="align-items:center">
<button type="submit">
<img src="http://load.dot.kr/dmg/search.png"
name="inn" alt="innSearch" style="width:20px">
</button>
</form>
The page has 2 submit buttons.
They are “out” button on the left and “inn” button on the right.
If you click one of the buttons, it will go “search.php” which has the code below.
<?php
if (isset($_GET['key'])) {
echo 'Yes $_GET["key"]=' .$_GET['key']. '<hr>' ;
} else {
echo 'No $_GET["key:]<hr>';
}
if (isset($_GET['out'])) {
echo 'Yes $_GET["out"]=' .$_GET['out']. '<br>' ;
} else {
echo 'No $_GET["out"]<br>';
}
if (isset($_GET['inn'])) {
echo 'Yes $_GET["inn"]=' .$_GET['inn']. '<hr>' ;
} else {
echo 'No $_GET["inn"]<hr>';
}
if (isset($_POST['out'])) {
echo 'Yes $_POST["out"]=' .$_POST['out']. '<br>' ;
} else {
echo 'No $_POST["out"]<br>';
}
if (isset($_POST['inn'])) {
echo 'Yes $_POST["inn"]=' .$_POST['inn']. '<br>' ;
} else {
echo 'No $_POST[inn]<br>';
I like to know in search.php which button between “out” and “inn” is clicked at the previous page.
As I test for it, I can get no $_GET[‘out_or_inn’] at search.php.
How can I send not only $_GET[‘key’] but also $_GET[‘our_or_inn’] to the next page?
I mean “search.php?key=aaa&out=” or search.php?key=aaa&inn=" instead of "that “search.php?key=aaa”.