Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- How Does One Pass "inurl:" via an html Form?
- Atlantic Illumination Entertai
June 26, 2011, 6:57 pm
rate this thread
I am having an issue with "site:" not reliably searching subdirectories
below a tilde (~). The way around this is to use "inurl:" This is fine
unless one wants to have a "Search" form on a website under another's
domain. In that case, I need to pass "inurl:" with the subdirectory path
to the search engine in a manner that "site: is passed via
How can I do something such as:
input type="hidden" name="as_inurl" value="*subdirectory-path"
Now yes I could add it to the "Search" field:
input type="text" name="q" MaxLength="150" Size="60" Value="inurl:etc"
...but it will appear as visible text. )-:
- Atlantic Illumination Entertai
June 29, 2011, 2:41 pm
Re: How Does One Pass "inurl:" via an html Form?
*** Since I first posted my query, I have been busy investigating and
experimenting and have found a solution for searching `/~' (slash-tilde)
pages via an automated html form.
This was an issue on my personal website, not my company one. The
latter has its own domain, while the former does not. Google's "site:"
feature works only sporadicly with websites that don't have their own
domain. The form code below gets around that. Feel free to use it.
Html Code for Google Search
This is the basic form code to search `/~' (slash-tilde) pages. No table
or other html formatting are included here. As well, since this is a
text newsgroup, I have removed the opening and closing angle brackets
for each line. To see my full code, view the source at:
Substitute your URL particulars and "Submit" button wording for mine so
as to have it search your website. Also, you may prefer to use
"Google.com" instead of the Canadian site; it won't matter for www
Form Action="http://www.google.ca/search " Method="Get"
Input Type="Text" Name="q" MaxLength="150" Size="60"
Input Type="Hidden" Name="as_q" Value="inurl:/~ak621/"
Input Type="Hidden" Name="as_sitesearch" Value="chebucto.ns.ca/"
Input Type="Submit" Name="sa" Value=" RB Website Search "
The way this works is to use the same "Name" attribute as for the user
input (Search) field. `q' is required for this. Whatever text is typed in
the "Search" field will be sent via the "Submit" line to the URL specified
through the "Action" attribute in the first line. In this case, it's to
Google's "Search" page.
So now to include "inurl:" and the accompanying URL fragment in that,
the next line uses a Name of "as_q". That means to work in the same manner
as does `q'. Thus, it will append to the search terms whatever text is
placed into the "Value" attribute on that line. In this case, it's
"inurl:" plus the path of the subdirectory which is my website at my
Chebucto ISP. (Pronounced "sh-BUCK-toe")
The next line will send "site:" and the Chebucto domain to Google via
"as_sitesearch". The final line submits the works. So when one types in
search terms at a website with the preceding code, Google receives this
line including proper spacing:
(search terms) inurl:(path) site:(domain)
This tells Google to look for the specified terms in "path" and
below at "domain". One can even use Boolean operators which many
site-specific CGI scripts do not do.
My site-specific search engine now works better than it ever did
because "inurl:" is much more thorough in looking into subdirectories at
websites without their own domain names than is "site:".
Feel free to e-mail me if more information is needed.
Happy Searching! (-: