Home  >  Article  >  Web Front-end  >  When submitting a form using the Get method, is it not possible to pass parameters through the URL? _html/css_WEB-ITnose

When submitting a form using the Get method, is it not possible to pass parameters through the URL? _html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:02:261612browse

The code is as follows:

<form  method="get" action="test.php?flag=test" target="_blank">	<input type="submit" /></form>


The php server is very simple, it just gets the value of the flag and outputs it directly!

I found that the above code only works when method="post" is used! When using "get", do I have to submit parameters through "


Reply to discussion (solution)

get is to pass parameters after url?.

Either way! But it’s a form! The url address in action='url' can also be modified. It will be displayed in the address bar. When you get the value on the php page, use it as a get method. Get it;v = $_GET['name']

Okay, I won’t ask! If you don’t know, why don’t you come back after doing the experiment?

After submitting according to my code, test.php cannot get the value of flag!

Well, that won’t work. It will reorganize the following parameters.

Okay, I won’t ask! If you don’t know, why don’t you come back after doing the experiment?

After submitting according to my code, test.php cannot get the value of flag!


If you made a mistake in writing your own code, don’t say that others haven’t done it.

The poster uses this get method to get the parameters of the url.

index.asp

<%	response.write request("flag")%><form  method="get" action="index.asp?flag=test">    <input type="submit" /></form>

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn