-1

I'm looking at the source code for bing.com for the file that processes the search upon submittance.

The search bar form for bing.com is like so:

<form action="/search" class="sw_box" id="sb_form" onsubmit="return si_T('&amp;ID=FD,6.1');">

I have 2 questions:

(i) What method is this form sent by? Where is the method="GET" or method "POST"?

(ii) Where is the form data sent to? What does "/search" mean, and does it imply bing.com/search.php or asp?

shawn a
  • 799
  • 3
  • 13
  • 21

3 Answers3

3

What method is this form sent by? Where is the method="GET" or method "POST"?

The invalid value default for these attributes is the GET state. The missing value default for the method attribute is also the GET state.

Where is the form data sent to? What does "/search" mean?

It is a relative URI starting with a / so, assuming there is no <base> element, $FOO/search where $FOO is the current scheme and hostname.

and does it imply bing.com/search.php or asp?

No.

There might be a search.php file or a search.asp file, and the server might map /search onto one of them, but that would be internal to the server. It is of no concern to the browser and there is no way to tell what is happening inside the server without access to it through some mechanism other than HTTP.

It could be handled by something else entirely, I run a site where /tag/ (and everything else that isn't a static file) is mapped on to /home/sitename-web/src/AppName/script/appname_fastcgi.pl/. That program then determines the response to send based on the URI.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
0
  1. The default is GET, when the method attribute is omitted

  2. /search means /search. This can be /search/index.html or /search/index.php or whatever. We don't know. This depends on the server configuration and possible a .htaccess file.

Community
  • 1
  • 1
markusthoemmes
  • 3,080
  • 14
  • 23
0

1) The default method of a form is GET

2) /search probably does not refer to a physical file on disk (like search.asp or search.php). Instead, when the server receives a request for /search, it uses URL routing to choose what to do with the request (in this case execute a search and show results).

Community
  • 1
  • 1
just.another.programmer
  • 8,579
  • 8
  • 51
  • 90