Solved

get form bug : = becomes %3D ....

Posted on 2004-09-02
11
277 Views
Last Modified: 2010-04-09
Hi - This get form converts the '=' and '&' signs into '%3D' and '%26'


I tried giving the second value a name "myapple" but it still doesn't work however I play with it.


========
<body>

<form method="get">
<input type="hidden" name="keywords">

<input type="hidden" name="myapple" value="locale=us&mode=blended&input_string">



<input type="text" name="search" size="20" maxlength="255"><br />


<input type="submit"style="width:150;text-align:center" value="listings"onclick="this.form.keywords.value = this.form.search.value; this.form.action = ' http://www.isearch.com/cgi-bin/ppc/search/smartsearch.cgi?keywords ';"> <br />

<input type="submit"style="width:150;text-align:center" value="Amazon"onclick="this.form.keywords.value = this.form.search.value; this.form.action = ' http://www.theeas.com/cgi-bin//us.cgi?locale=us&mode=blended&input_string ';"> <br />

</form>  



</body>
</html>
0
Comment
Question by:macuser777
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
11 Comments
 
LVL 33

Expert Comment

by:knightEknight
ID: 11966860
this is correct actually, you just need to decode (or unescape) the value passed, e.g.:

this.form.keywords.value = unescape(this.form.search.value)
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 11966870
OH WAIT!  I didn't see that you were changing the action of the form ... in that case do it in the cgi, not in the script as I have shown above.
0
 
LVL 4

Author Comment

by:macuser777
ID: 11966928
>>>>I didn't see that you were changing the action of the form ... in that case do it in the cgi, not in the script as I have shown above.          

any way of doing it without going into the cgi? the cgi is an off the shelf which I have no idea how to get round. I know next to nothing...really next to...about cgi.

If there's no other way if you give me some guidance i'll get a freelance to do it.

theres a bit more to it...Thanks

<input type="text" name="search" size="20" maxlength="255"><br />

<input type="submit"style= "width:150;text-align:center" value="Web Search" onclick="this.form.keywords.value = this.form.search.value; this.form.action = ' http://www.iarch.com/cgi-bin/search/smartsearch.cgi?keywords ';"> <br />

<input type="submit" style="width:150;text-align:center" value="Dmoz" onclick="this.form.keywords.value = this.form.search.value; this.form.action = ' http://www.search.com/odp.php ';"> <br />

<input type="submit"style="width:150;text-align:center" value="PPC listings"onclick="this.form.keywords.value = this.form.search.value; this.form.action = ' http://www.iarch.com/cgi-bin/ppc/search/smartsearch.cgi?keywords ';"> <br />

<input type="submit"style="width:150;text-align:center" value="Amazon"onclick="this.form.keywords.value = this.form.search.value; this.form.action = ' http://www.ther.com/cgi-bin//us.cgi?locale=us&mode=blended&input_string ';"> <br />

</form>  
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Author Comment

by:macuser777
ID: 11967578
the other pproblem is that the normal search comes up

us&input_string=river&mode=blended


and i've had to change it to

us&mode=blended&input_string=river

to make it 'work'
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 11967896
you can try changing the form from "get" to "post" ...
the default behavior for get is to encode those characters on the query string, so it would have to be done at the cgi.
0
 
LVL 4

Author Comment

by:macuser777
ID: 11968115
Ok - by just changing the get to post the other 3 stay working and the query string in the last stays intact...but it does a blank search

maybe it's not coded right - here's the actual code --- if you post an answer PLEASE change the url's so the domains don't get spidered by google on this page

When you get to the amazon search you can type in any query to see how the url normally appears

===========
<form method="post">
<input type="hidden" name="keywords">

<input type="hidden" name="locale=us&mode=blended&input_string">

<input type="text" name="search" size="20" maxlength="255"><br />

<input type="submit"style= "width:150;text-align:center" value="Web Search" onclick="this.form.keywords.value = this.form.search.value; this.form.action = ' http://www.i   ~~~~~ pure ~~~~~ search.com/cgi-bin/search/smartsearch.cgi?keywords ';"> <br />

<input type="submit"style="width:150;text-align:center" value="PPC listings"onclick="this.form.keywords.value = this.form.search.value; this.form.action = ' http://www.i   ~~~~~   pures  ~~~~~~ search.com/cgi-bin/ppc/search/smartsearch.cgi?keywords ';"> <br />

<input type="submit"style="width:150;text-align:center" value="Amazon"onclick="this.form.keywords.value = this.form.search.value; this.form.action = ' http://www.the~~~~~easy   ~~~~  river.com/cgi-bin//us.cgi?locale=us&mode=blended&input_string ';"> <br />

</form>  
0
 
LVL 4

Author Comment

by:macuser777
ID: 11976951
some progress...

I can stop the code rewriting by splitting up the query, but the problem now is with the form names. The last serach would work if I could get the &search= out of the url. I've tried taking out 'search' completely and replacing with input_string throughout but that disables the second search???

It's no better using post instead of get.

<form method="get">  
 <input type="hidden" name="keywords">  
 
 <input type="hidden" name="locale" value="us">  
 <input type="hidden" name="mode" value="blended">  
 <input type="hidden" name="input_string">  
 <input type="text" name="search" size="20" maxlength="255"><br />  
 
 <input type="submit"style= "width:150;text-align:center" value="Web Search" onclick="this.form.keywords.value = this.form.search.value; this.form.action = ' http://www.isearch.com/cgi-bin/search/smartsearch.cgi?keywords ';"> <br />  
 
 <input type="submit"style="width:150;text-align:center" value="DMOZ"onclick="this.form.keywords.value = this.form.search.value; this.form.action = ' http://www.isearch.com/odp.php ';"> <br />  
 
 <input type="submit"style="width:150;text-align:center" value="PPC listings"onclick="this.form.keywords.value = this.form.search.value; this.form.action = ' http://www.isearch.com/cgi-bin/ppc/search/smartsearch.cgi?keywords ';"> <br />  
 
 <input type="submit"style="width:150;text-align:center" value="Amazon"onclick="this.form.keywords.value = this.form.input_string.value; this.form.action = ' http://www.theeasyriver.com/cgi-bin/us.cgi? ';"> <br />  
 
 </form>
0
 
LVL 4

Author Comment

by:macuser777
ID: 12025717
Hi knightEknight.

I've solved this by changing the search form name in the php search.

Please tell me how you'd like to close this q up.

Thanks for the input

macuser                    
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 12025731
post a comment for admin to refund your points.
0
 

Accepted Solution

by:
CetusMOD earned 0 total points
ID: 12057876
Closed, 150 points refunded.
CetusMOD
Community Support Moderator
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Help with mod_substitute 18 77
How to escape unsafe HTML tags 4 50
Displaying Text in Columns in HTML 3 32
CSS styling problem 3 27
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question