Is it possible to share GET and post in a form?

I have a form on my website. I want to add a GET and send the option together. Which will point to 2 different destinations. Example: - when someone submits a form (name and address), he can enter a restricted section. Then the code will be

<form name="loginform"
action="http://site.com/viparea"
method="post">

And next to this, I want to keep a journal. And for the log code

<form name="loginform"
action="logcode.php"
method="GET">

And the encrypted log will be saved in a text file.

I used two methods separately. And they work great individually. But I want to make them work together. So, I'm not an encoder, but after searching for something, I just did a simple job like noob: P.

<form name="loginform"
action="http://site.com/viparea"
method="post"><form name="loginform"
action="logcode.php"
method="GET">

But does not work. Any suggestion please.

+5
source share
2 answers

You can achieve this only with:

<form name="loginform" action="http://site.com/viparea?var1=var&var2=var" method="post">
    <input type="text" name="var3" />
</form>

var1 var2 $_GET, var3 $_POST 3 vars $_REQUEST

+6

, ; php $_ REQUEST [], GET, POST; php-.

0

All Articles