Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2004-09-02
11
Medium Priority
?
281 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
  • 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
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!

 
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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
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).

971 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