The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> need help in basic iput html
raj4142
post Jun 17 2021, 11:45 AM
Post #1


Newbie
*

Group: Members
Posts: 11
Joined: 17-June 21
Member No.: 27,982



Hi
Can someone help me to code this, i need basic html only for offline

https://www.google.in/s?p_4:xxxx,p_n_pct:yyyy-&s=date

above is example url

I need two box where i can xxxx and yyyy value and it opens. example if in xxxx - put 100 and yyyy i put 500 then it url opens

https://www.google.in/s?p_4:100,p_n_pct:500-&s=date



User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jun 17 2021, 03:29 PM
Post #2


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



I don't understand what you want to do. What you have after the ? is a query string and it can't be formatted the way you have it. Furthermore it must be meaningful, i.e. a script on the server must be evoked and interpret what you have in the query string and do something with it. You can't just put anything in a query string.

So what exactly is it you try to accomplish?

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
raj4142
post Jun 17 2021, 10:57 PM
Post #3


Newbie
*

Group: Members
Posts: 11
Joined: 17-June 21
Member No.: 27,982



no
I am giving you example. If i want to search keyword "Nokia" in Amazon

i need to go to amazon > search for Nokia

url for this is, https://www.amazon.com/s?k=nokia&ref=nb_sb_noss

if i replace "Nokia" with any keyword it search for same.

i want to make one html page for many search and store in my local pc, so from there i can visit there where i want.

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
raj4142
post Jun 17 2021, 10:59 PM
Post #4


Newbie
*

Group: Members
Posts: 11
Joined: 17-June 21
Member No.: 27,982



See iamage https://ibb.co/267Sy27
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
raj4142
post Jun 17 2021, 11:03 PM
Post #5


Newbie
*

Group: Members
Posts: 11
Joined: 17-June 21
Member No.: 27,982



Thta is exactly what i want and there might be 2 field input for url for example

https://www.amazon.com/s?k=nokia&price=500

here i might change nokia and 500
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jun 17 2021, 11:19 PM
Post #6


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



So it's creating the form you want help with?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
raj4142
post Jun 17 2021, 11:35 PM
Post #7


Newbie
*

Group: Members
Posts: 11
Joined: 17-June 21
Member No.: 27,982



yes
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
raj4142
post Jun 17 2021, 11:37 PM
Post #8


Newbie
*

Group: Members
Posts: 11
Joined: 17-June 21
Member No.: 27,982



Something like this

<form id="form">
<input type="search" id="query" name="q" placeholder="Search...">
<button>Search</button>
</form>

This i will save as html page in my pc.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jun 17 2021, 11:58 PM
Post #9


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



amazon doesn't seem to recognize your price bit though.

A query string consists of name-value pairs. They can't be random. They names must be known by the program they are sent to and the values must make sense too. If you use the drop down to the left of the search field at Amazon, search for something and look at the query string you can see what names correspond to the different departments. That's all you can do.

The form goes like this. Note that you must use the URL https://www.amazon.com/s in the action attribute.

CODE
<form action="https://www.amazon.com/s" method="get" enctype="text/plain">
<input type="text" name="k">
<input type="submit">
</form>


If you want more search terms you just add more text inputs, but with existing names. Same goes for any site. You have to do a little reverse engineering to find out what you can use.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
raj4142
post Jun 18 2021, 12:05 AM
Post #10


Newbie
*

Group: Members
Posts: 11
Joined: 17-June 21
Member No.: 27,982



wow, working fine thannk.

But how can i add 2 field in one search

https://www.amazon.com/s?k=amazon&page=3

Example if want to change amazon and page number in above url like https://www.amazon.com/s?k=samsung&page=5
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jun 18 2021, 03:15 AM
Post #11


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



You add another form field for that.

Take a look at how the URL https://www.amazon.com/s?k=amazon&page=3 is constructed.

https://www.amazon.com/s is the base URL. The ? is the start of the query string. After that comes any number of name-value pairs separated by ampersand.

CODE
http://example.com?name1=value1&name2=value2&name3=value2&name4=value4.


So you need to add another field and give it the name 'page'. You could use another text field or you could use SELECT, like this. The question mark and ampersands will happen automatically.

CODE
<form action="https://www.amazon.com/s" method="get" enctype="text/plain">
   <input type="text" name="k">
   <select name="page">
      <option>Choose page</option>
      <option>1</option>
      <option>2</option>
      <option>3</option>
      <option>4</option>
      <option>5</option>
      <option>6</option>
      <option>7</option>
      <option>8</option>
      <option>9</option>
      <option>10</option>
   </select>
   <input type="submit">
</form>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
raj4142
post Jun 18 2021, 08:43 AM
Post #12


Newbie
*

Group: Members
Posts: 11
Joined: 17-June 21
Member No.: 27,982



biggrin.gif Thanks
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
raj4142
post Jun 18 2021, 09:23 AM
Post #13


Newbie
*

Group: Members
Posts: 11
Joined: 17-June 21
Member No.: 27,982



what i got, it works fine if url has = value

<form action="https://www.amazon.com/s" method="get" enctype="text/plain">
<input type="text" name="k">
<input type="text" name="page">

in above example its k=*&page=* (*=whatever we put in field)

but how to do same if instead = there is something else, example

pct-off:70 here i want to edit value 70 so i a i add this,

<input type="text" name="pct-off:">
Then it doesn't work as i don't need to add = in ur
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jun 18 2021, 09:40 AM
Post #14


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



Did you invent the name "pct-off" yourself? If so that's why it doesn't work.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
raj4142
post Jun 18 2021, 09:54 AM
Post #15


Newbie
*

Group: Members
Posts: 11
Joined: 17-June 21
Member No.: 27,982



not myself, i need for some other
Giving you one real example https://www.amazon.in/s?i=kitchen&bbn=9...=price-asc-rank

in above i want to change 70 only in whole url with custom field, it can be 80 or 66 or 40 any number value. How to do that kind of search form?

as its value is p_n_pct-off-with-tax:70-
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jun 18 2021, 11:14 AM
Post #16


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



Well, the name-value pair in this case is this whole shebang.

CODE
rh=n:976442031,p_85:10440599031,p_6:AT95IG9ONZD7S,p_n_pct-off-with-tax:70-


You must have all of that and just change the number.

CODE
rh=n:976442031,p_85:10440599031,p_6:AT95IG9ONZD7S,p_n_pct-off-with-tax:90-


Easy to type, but a whole lot more involved to get into your form. You'd need a script to process the input, so you can type just the number, for example 90, and the script adds the rest of the value before it redirects the browser to amazon.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
raj4142
post Jun 18 2021, 11:21 AM
Post #17


Newbie
*

Group: Members
Posts: 11
Joined: 17-June 21
Member No.: 27,982



ok
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jun 18 2021, 02:22 PM
Post #18


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



Just getting that whole shebang for the rh name into the input field in the form isn't that hard with a little JavaScript. But that alone doesn't work. It seems that these bits are also needed.

CODE
bbn=976442031

CODE
s=price-asc-rank


The last seems straightforward, but I have no idea what the first is and if its value should change for different searches and if so what it should be.

Where do you find these search options on Amazon?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 28th March 2024 - 02:28 PM