Link to home
Start Free TrialLog in
Avatar of Overthere
Overthere

asked on

Can Not pull contents of a textarea

Hi Folks,
   I am scrapping some web pages. I have a simple asp page with a textarea and the next page pulls from the textarea to do some scrapping etc. All of the test pages that am scrapping are fine. However, I have to test examples in which my page will not pull the data from the textarea and I have no clue why. I thought perhaps I needed to increase the rows in the textarea but that should not matter - wouldn't it simply send what it could?
 I am using localhost, classical asp  and all of other examples process just fine - I can pull the contents of the textarea.
I have enclosed the coding from my two pages. The contents of the textarea will contain the source code that is copied and pasted from either emails or html pages. As I have said, all my other examples work fine EXCEPT for 2 and those 2 are the ones I need to process the most. Any help is appreciated. The error message I receive is this:

Error Message:
The website cannot display the page
 
  HTTP 500    
Most likely causes:
•The website is under maintenance.
•The website has a programming error.
 This error (HTTP 500 Internal Server Error) means that the website you are visiting had a server problem which prevented the webpage from displaying.

 Below is my textbox page:

Default.asp
 
<%@ Language=VBScript %>

<html>
    <head>
        <title>Default Page</title>

    </head>
    <body>
 
     <form method="post" action="Page.asp" name="Page.asp">
    Paste Text the Data to be Extracted into the box.</br>
    Then click the Submit Button</br></br>

      <textarea  id="txtinfo1" name="txtinfo1" rows ="25" cols="80"> </textarea>
        <br />
   
    <input type="submit" name="Submit" value="Submit">
</form>          
    </body>
</html>

Open in new window


And this is my page to pull the content of the textbox:

<%@ Language="VBScript" %>
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title></title>
    </head>
    <body>
<% 
dim sText 

     response.write "Am at Page.asp" & "<br>"

         sText = Request.Form("txtinfo1")
         if sText = "" or isNull(sText) then
            write "Unable to pull text"
         else
           strLength = Len(sText)
           response.write "length" & "<br>"
           response.write sText 
           response.write strLength
        end if
         %>
    </body>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of sammySeltzer
sammySeltzer
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Shaun Kline
Line 16 in the code for the second page has a syntax error. It should be response.write, not just write. The syntax error will cause the http 500 error message.
Avatar of Overthere
Overthere

ASKER

Line 16 was my error in typing it in the question box...
No database is being used. I am simply having a user copy and paste their source code from an HTML page so I can scrap the data from the HTML page that I need.
I will try unchecking the friendly HTTP option and see what happens. I will keep you folks posted and I appreciate both of you responding...
If you submit a blank/simple textarea, you get no error, correct? Then the error must be happening in the code being submitted. Instead of writing the submitted text directly to the page, either put it into a text area on your results page, or replace all of the less than/greater than signs with their equivalent HTML codes (&lt; / &gt;). This will allow you to verify that it is the submitted code causing the issue, not your page. From there, you would need to review the submitted code to see what is being posted. You could also use the W3C Markup Validation Direct Input tool to see if there are any errors in the HTML that could be causing the issue.
you can also try using the Server.HTMLEncode function, this'll allow you to display special characters in html

Response.Write Server.HTMLEncode( Request.Form("txtAreaName") )
I appreciate everyone helping but I need to clarify something here.  One thing is that  the user pastes  html code from emails or other html pages into the textarea, I pull what they have pasted in the textarea into a variable, hence:     sText = Request.Form("txtinfo1")
Then I  decode the html chars that I don't want etc and pick out the data from strings - I am scrapping data from what they paste into the textarea. Not redisplaying what they have pasted.

This is what I found concerning the error message but what confuses me is that I am not attached to a server for web development, I am using my laptop in localhost mode, Windows 7. So how  in the heck do I apply the solution??
Here's what I found:

This is a server side issue related to the settings related to the IIS service.  When you received this error, the amount of data that can be received in the "request object" is likely restricted, some servers have a restriction as low as 200 KB.  

To work around this issue, you should contact your web Administrator or use 3rd party FTP software to upload larger files.

There are some technical workarounds, related to the metabase.xml, such as modifying these settings:

Change
AspMaxRequestEntityAllowed="204800"
to
AspMaxRequestEntityAllowed="10238976"
Well, you didn't say anything about uploading file to the server or the database (bad idea).

My best guess then would be that perhaps, you need to increase the size of the fieldname since it is textarea.

Now, if you are uploading a file, then modifying the metabase.xml makes sense.

More info is needed from you.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thank you, you folks have been very helpful and now I am going to backup and try the solution. I am awarding points to both SammySeltzer and BigMonty because together you really help me to move forward with a resolution. If this is ot satisfactory please let me know....
Thank you everyone, your help was appreciated.