Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Malformed Syntax Errors

Status
Not open for further replies.

Dollie

MIS
May 2, 2000
765
US
I'm finally getting the hang of ASP!&nbsp;&nbsp;Well, sort of!&nbsp;&nbsp;I finally got my pages published using Drumbeat 2000.&nbsp;&nbsp;(I'm in the process of learning Dreamweaver UltraDev.)&nbsp;&nbsp;While I was doing my celebratory dance over my new pages, someone asked, &quot;Have you tested the pages on Netscape?&quot;&nbsp;&nbsp;The dancing stopped.<br><br>AGH!&nbsp;&nbsp;My initial page where keywords are entered works fine, as does the results page.&nbsp;&nbsp;The detail page (when a certain result is clicked on) displays the following message: <br><br>&quot;HTTP Error 400<br><br>400 Bad Request<br><br>Due to malformed syntax, the request could not be understood by the server. The client should not repeat the request without modifications.&quot;<br><br>Lovely!&nbsp;&nbsp;I know someone, somewhere has run into this problem with Netscape before....or is it just me? hehe<br><br>Also, when viewing the same page in Internet Explorer, I've found that it does not display the details of just one search result, it displays several.&nbsp;&nbsp;I've made miscellaneous changes within Drumbeat that should have fixed it, and I have the feeling I have to start digging through the code to fix this one!<br><br>Thanks in advance for any help!<br><br>Waving a large white flag in surrender,<br>Dollie<br>
 
check the URL, also I think it works best if you use Microsoft Interdev 6, for ASP development, it may appear that as you are passing values to the new ASP , that the URL isnt being setup correctly, it may also help if you gave some more details. <p>Karl<br><a href=mailto:kb244@kb244.com>kb244@kb244.com</a><br><a href= </a><br>Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)<br>
 
Usually, you get this error in Netscape when you pass parameters with spaces in your querystring:<br><br>&lt;a href=&quot;somepage.asp?name=asp<font color=red></font> forum&quot;&gt;<br><br>In this case you need to use Server.urlencode()method :<br>&lt;a href=&quot;somepage.asp?name=&lt;%=Server.urlencode(&quot;asp forum&quot;)%&gt;&quot;&gt;<br><br>Of course, this is just an example.
 
Guestg is absolutely right.&nbsp;&nbsp;IE will try its best to URL Encode the URL for you.&nbsp;&nbsp;Netscape doesn't.&nbsp;&nbsp;If you have any spaces or special characters in your URL, Netscape chokes... and kicks that ugly error you describe.&nbsp;&nbsp;Use Server.URLEncode on any parameters you hope to pass thru your querystring. <p> Jeff Friestman<br><a href=mailto: jfriestman@hotmail.com> jfriestman@hotmail.com</a><br><a href= View my Brainbench transcript</a><br>Brainbench 'Most Valuable Professional' for ASP<br>
Brainbench 'Most Valuable Professional' for JavaScript<br>
 
Ok, I found the part of the code that is giving me so much grief in Netscape, but now I'm not real sure what to do with it!&nbsp;&nbsp;The problem is the &quot;Job Code&quot; portion of the record.&nbsp;&nbsp;Here's a portion of the code: <br><br>&lt;A HREF=&quot;JobDetail.asp?Recordset1_Action=Find('Job Code','&lt;%=Server.URLEncode(ReplaceSingleQuoteWithTwo(Recordset1.GetColumnValue(&quot;Job Code&quot;)))%&gt;')&Recordset1_Position=&lt;%=Server.URLEncode(Recordset1.GetState())%&gt;&quot;&gt;<br><br>Do I need to change &quot;Job Code&quot; to &quot;JobCode&quot; in the database?&nbsp;&nbsp;<br><br>Sorry if this is a dumb question, the code is confusing still!<br><br>Thanks a TON!<br>Dollie <p> <br><a href=mailto: > </a><br><a href= > </a><br>Continually chipping away at the glass ceiling...
 
Hello, Dollie!<br>You're absolutely right that 'the code is confusing still'.<br>I don't think that you want to pass all these scary parameters to the JobDetail.asp?!<br>What I'd suggest you to do is:<br>use some variable to store whatever <font color=red>Find('Job Code',ReplaceSingleQuoteWithTwo(Recordset1.GetColumnValue(&quot;Job Code&quot;)))</font><br>will find and then use urlencode:<br>Recordset_action=&lt;%=server.urlencode(&quot;this_variable_value&quot;)%&gt;<br>And so on with all your parameters.<br>This is a suggestion.<br>So, just try it before you change the column name in the database.
 
OK...y'all only *thought* my other questions were goofy.&nbsp;&nbsp;I'm about to blow that thought out of the water!&nbsp;&nbsp;I've really got my head up my .asp today!<br><br>Dummy questions of the day:&nbsp;&nbsp;Where do I put URLEncode?&nbsp;&nbsp;Does it go on the page that is not displaying, or on the page before it?&nbsp;&nbsp;Where in the code does it go?&nbsp;&nbsp;<br><br>I can't tell y'all how much I appreciate the answers I've gotten!&nbsp;&nbsp;I just hope that I'll be able to help instead of being helped. :)<br><br> <p> <br><a href=mailto: > </a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top