@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2



Comments:

<0> be back later
<1> shouldnt this work ?
<1> if not IsEmpty(Request.form("comment")) then
<1> strTextField = Request.form("comment")
<1> strSQL = "INSERT INTO tblBlog (comment) VALUES (strTextField);"
<1> I get an error on if not IsEmpty(Request.form("comment")) then
<1> strTextField = Request.form("comment")
<1> strSQL = "INSERT INTO tblBlog (comment) VALUES (strTextField);"
<1> shift
<1> SQLState: 4 Native Error Code: 1054 [TCX][MyODBC]Unknown column 'strTextField' in 'field list'
<2> strSQL = "INSERT INTO tblBlog (comment) VALUES ('" & ESCAPETHIS****(strTextField) & "');"
<1> I have <TEXTAREA NAME="comment" ROWS=4 COLS=87 title="Hier kan u uw op/aanmerkingen of groetjes doen."></TEXTAREA> in the form. Can I set the value to 'nothing' as it returns the previuos value ??
<1> so the isempty does nothing
<2> ?
<1> and it updates my table even if I don't want it to
<2> s=cstr(Request.form("comment"))



<2> is len(s)=0 then nuttin
<1> well that is the problem, it does not get to 0
<1> the value stays ?
<1> this is the code : http://www.nomorepasting.com/paste.php?pasteID=67001
<2> what do you mean 'stays' ?
<1> as you can see in the code, he does get into the if
<1> mh
<1> so if I put the response.write before the if, the contents is printed on screen
<1> so when I refresh the page the value is still there
<2> you mean the text stays in the box when the page loads after you click Voeg toe?
<1> no the text in the box (textarea) is gone
<1> so request.form should be empty
<1> but the request.form keeps returning the value
<2> i dont follow
<2> if you click the button request.form will contain commend
<1> if I click on refresh page the response.Write Request.form("comment") returns a value
<2> you get a warning about that, no?
<1> he shouldnt do that , should he because then the db would be updated, even if there is nothing in the textarea
<1> no
<2> what browser are you using?
<1> ie
<1> in ff the same
<1> there I did get some error
<1> should I use get maybe in the form instead of post?
<1> or set some caching to no-caching ??
<1> (I do not have access to a server in this case though as it is hosted by some internethost)
<2> if you load a page with a posted form and do nothing, you shouild be able to refresh fine
<2> if you load a page with a posted form and use the form, on the page that then loads, hitting refresh should pop up a warning box
<2> as if you refresh the results page from a post, you are re-posting
<1> yuo saw my code jst yet ? should I do the addtodatabase in a separate asp file then ??
<1> and let it return to the postform when updated ?
<2> i dont understand your issue
<2> whats the url of that page
<1> ttp://www.buvingen.be/blog/inputform.asp
<1> http://www.buvingen.be/blog/inputform.as
<1> http://www.buvingen.be/blog/inputform.asp
<1> aaargh
<2> change it back to post
<1> don
<1> e
<2> ok, so i added "www" and click the button
<2> i see www written at the top of the page tht then loads
<2> your issue is what if a user presses f5 at that point?
<1> yes, the request.form('comment') should be empty when there is nothing in the textfield because in the case it is now, he just keeps adding old data to the databse
<2> if they refresh you mean?
<1> once one has clicked on Voeg Toe and then keeps refreshing the data of the textfield keeps been adding to the database, you can see it now for yourself
<1> so after the VoegToe the request.form should be empty
<2> but it isnt, when you refresh you repeat the last action
<1> yes
<1> so it seems
<1> allthough the textarea box is empty
<1> it is still in some cache or what ?
<2> yes, but you have just given the page the form
<2> if you used get, you would see comment= in the url
<1> so itwould not work
<1> with get
<1> or?
<2> no, same thing
<1> so what do you suggest
<1> put the addtodatabse code into a separate file so it only gets executed when clicked on VoegToe ??
<2> the same thng would happen, refresh repeats whatever the form did



<2> can a user enter > 1 comment?
<1> oh
<1> euhm there will be two boxes, one for his name, one for the comment
<1> and under the boxes all the comments will appear
<2> the only thing you can do is check for an existing entry
<2> either by keeping the last one in memory in a session variable
<2> or by querying the db before the insert
<1> pfff what a problem
<2> thats what refreshing does
<1> how do they do it normally on 'blogs' ?
<2> i doubt they bother much
<1> oh :)
<2> refreshing will make ie show a warning box to the user about reposting
<1> I don't get a message
<1> ah wait
<2> ---------------------------
<2> Microsoft Internet Explorer
<2> ---------------------------
<2> The page cannot be refreshed without resending the information.
<2> Click Retry to send the information again,
<2> or click Cancel to return to the page that you were trying to view.
<2> ---------------------------
<2> Retry Cancel
<2> ---------------------------
<1> yes I did get it, never noticed it , I just used to click retry :)
<2> most ppl i think will hit cancel
<1> lol
<2> the session approach is ok for small amounts of data
<1> would you use it, or just don't bother it
<2> i probably would not bother and write a query to delete duplicates every now and then
<1> going for that then :)
<1> say in the database the timestamp is saved as 20060815143334 but on the page it is shown as 8/15/2006 2:33:32 PM can I change it into a 24hours system ?
<3> I don't see why not
<3> It's already stored as a 24 hour time
<3> So just don't convert it into 12-hour time
<1> I don't convert
<1> I just did response.Write " tijd: " & objRS.fields("datum") & " "
<3> Then who does
<3> So, ASP knows to magically convert that into another format?
<1> well
<1> has it something to do with : <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<1> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">;
<1> <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<1> ?
<3> Nothing at all
<3> Either it's not stored in the database in that fashion, or something converts it.
<3> find out which
<3> looking for FormatDateTime(), or something that grabs various bits of the string would be a good place to start
<3> What is the data type of the field that stores the timestamp?
<1> timestamp
<1> timestamp(14)
<1> in mySQL
<3> Then likely the database converts it to a standard format as it returns
<3> ***uming that's the case, you're going to have to either have it not do that, and format the date yourself, or search for 'PM', and if you find it, change it to 'AM', and add 12 to the hours
<1> que
<2> qed
<3> indeed.
<3> You know how 24-hour time works, right?
<3> rather, you know the difference between 12 and hour hour time
<1> from 0 to 23
<3> and you know how 12-hour time works, right?
<1> 1-12
<3> and?
<1> AM PM
<3> Do you have even the slightest clue how to convert between the two?
<1> what with <%@ LCID=1043 %>
<1> no
<1> :)
<3> Then why are you trying to use it?
<3> It really is not a difficult concept
<3> If it's PM in 12-hour time, add 12 hours
<3> tadah
<3> That number is now the 24-hour time
<1> well if it is AM or PM does not matter if you add 12 to it, it should be ok no?


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #asp
or
Go to some related logs:

zoloft makes it hard to
papo yaar
#allnitecafe
KUMPİRCİLER
#chat-world
worldchat.at
#chat-world
barsaat webpage
joey_bb
#linux



Home  |  disclaimer  |  contact  |  submit quotes