Question for Ted

Author
Discussion

miniman

Original Poster:

26,308 posts

269 months

Tuesday 8th July 2003
quotequote all
Understand if you prefer not to answer this if it gives away any of your secrets...

I'm trying to do a dynamic newsletter on my site. I have an RTF editor to allow users to format the text, and I just need to write it into the database (MDB).

I have it working on the basis that on the click event on a button, a bit of javascript runs and redirects to a "process.asp" with a querystring of the HTML from the RTF editor. I'm just concerned that the HTML could get very big - how much data can I pass on the querystring?

Appreciate if you could tell me how you post the contents of a message to the database when I click "post new topic", as I'm about to do now!

Cheers...

PetrolTed

34,443 posts

310 months

Tuesday 8th July 2003
quotequote all
Use a form POST rather than passing it via queryString. It's more robust and doesn't require URLencoding and decoding to pass around.

miniman

Original Poster:

26,308 posts

269 months

Tuesday 8th July 2003
quotequote all
Thanks for the advice. Is a POST easy to do???

Edit: don't worry, figured it out!



>> Edited by miniman on Tuesday 8th July 13:09

Don

28,377 posts

291 months

Tuesday 8th July 2003
quotequote all
miniman said:
I have it working on the basis that on the click event on a button, a bit of javascrpt runs and redirects to a "process.asp" with a querystring of the HTML from the RTF editor. I'm just concerned that the HTML could get very big - how much data can I pass on the querystring?


About 4K I believe. Its not suitable for this purpose. As Ted said you need to POST the data.



miniman said:

Appreciate if you could tell me how you post the contents of a message to the database when I click "post new topic", as I'm about to do now!

Cheers...




What you do is have HTML a bit like this


<form id=form1 name=form1 method=post action="process.asp">
<input type=text id=text1 name=text1 value="">
<input type=submit>
</form>

Then instead of using Request.QueryString("text1") you use Request.Form("text1")

Check the form tags - I can't remember them accurately...

Edited to say: Oooops.

>> Edited by Don on Tuesday 8th July 13:11

miniman

Original Poster:

26,308 posts

269 months

Tuesday 8th July 2003
quotequote all
Thanks Don, that's exactly what I was after.

judas

6,069 posts

266 months

Tuesday 8th July 2003
quotequote all
You may also run into a 100k limit on POSTed data, depending on what platform/technology you're using (ie, Microsoft ). Can't remember the exact details, but we had this problem with one of our websites where once the HTML data went over 100k the database write would fail to execute properly and the code would just insert nothing into the field, losing all the data.

Some swift client re-education on why 100k+ web pages are a bad idea anyhow cured the problem