Form via GET

0

I'm sending data via get through the url form this way

<form  action="dashboard.php?link=products/home&so=app_windows" method="GET">
</form>

When sending, it always redirects to

dashboard/dashboard.php?so=app_android

instead of going to

dashboard/dashboard.php?link=products/home&so=app_android

some solution

    
asked by anonymous 25.08.2018 / 05:16

1 answer

1

You have not put in the code but when you use the get method the values of the elements of your form will be inserted into the url. So you probably have something like this:

<form  action="dashboard.php?link=products/home&so=app_windows" method="GET">

    <input type="text" name="so" value="app_windows">
    <input type="submit" name="" value="Enviar">

</form>

When you click submit, this url will be changed.

If you use this way:

<form  action="dashboard.php?link=products/home&so=app_windows" method="POST">

    <input type="text" name="so" value="app_windows">
    <input type="submit" name="" value="Enviar">

</form>

Your url will not change and you will be able to get the values via GET in the same way.

Or you can do this:

<form  action="dashboard.php" method="get">

    <input type="" name="so" value="app_windows">
    <input type="" name="link" value="products/home">
    <input type="submit" name="" value="Enviar">

</form>

It depends on what you think is best.

    
25.08.2018 / 06:27