Comments In ASP
I am using asp and mysql. I have a form that sends an e-mail and also the info is saved in a db so I can log how many messages went to whom. My problem is that I have a comment field that is a textarea input and I got this message:
Microsoft OLE DB Provider for ODBC Drivers error '80040e09'
[TCX][MyODBC]You have an error in your SQL syntax near 'i" This should go to Paul.","4","29","2002","10:08:24 AM")' at line 1
/shared/products/contact.inc.asp, line 292
I had sent successfully numerous times today before this, but in this message I had double-quotes - "i". I heard somewhere that mysql will barf on double quotes.
How can I modify them to single quotes before they go to the db? Again,the check would convert any double quotes to single quotes in a textarea input.
View Replies
I have quite a large website that I am trying to add a new feature to. Every once in a while an article will be posted that I would like people to be able to comment on. In this way - it is sort of like a blog - except I don't need any other features. However, I do need an admin page just to be able to delete any comments if needed.
I have done some searching for some code examples but I just get a lot of full licensed blog apps. If anyone knows of any sample code - or better yet, tutorials that I could follow, that would be greatly appreciated.
View Replies
View Related
I have an ASP page with a <textarea> on it that is posting the contents of the <textarea> into an Access database Memo field. When the form on the page is processed, I use the following code before putting the information into the database:
var mytextarea = Request("mytextarea")+"";
mytextarea = mytextarea.replace("'", "''");
This should deal with the single quotes in the text before the INSERT query The problem is that it only works if mytextarea has one quote. If there are more than one quote in mytextarea, I receive the following error:
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression ''Isn''t it funny this doesn't work'
Anyone know why it is not replacing all instances of single quotes in the string?
View Replies
View Related
I want to know what's the convenient way to comment out a block in ASP pages? I read a book, and I thought we can use /** */ to comment out the VBScript in ASP page, but it yields run time error.
All I know is to use ' but this is very slow if I want to comment out a block?
View Replies
View Related
im starting work on a new site and would like it to be a ASP site. I want users to be able to go onto a page of my site and post there own comments and then have those comments permantly stay there on that page. how I can do this?
View Replies
View Related
The use of includes in ASP is good where code is re-used in multiple forms,etc. (doh, ... that's what they _are_ for ! ). If I have something like: Code:
View Replies
View Related
I get some comments on a function I wrote? I posted on PlanetSourceCode so I could see what people think, but nobody seems interested, although I know this is a huge time-saver. It generates an update query for you based on the results of a form. It takes care of check whether or not the field is valid, is a string or numeric, etc. Code:
View Replies
View Related
An important thing to mention here is that when this data goes into my database table i'm using the UPDATE function to modify pre-existing records in the database.
The form that contains my textarea also populates the textarea with the current data from the database so when I submit data, when the page refreshes I should see, in the textarea, the data that I just submitted.
Another things worth mentioning is that when I UPDATE this information in the database, the content from the textarea goes through a instances of the replace() function. There is one in particular that I need but is causing problems:
strTextInput = Replace(strTextInput,chr(13) & chr(10),"<br />")
when the data from the textarea contains a line break I want that to become a break tag in the database. This works well EXCEPT for a line break that seems to always exist at the end of the text in the textarea when I submit my form to be processed. This trailing line break exists regardless of any attempts. If I have: Code:
View Replies
View Related
I'm trying to read in image data using the filesystemobject. I am able
to read the comments field for all file types it seems, except the ones
I want, .gif .jpg and .bmp.
Is it possible to do this?! If so what might I need to do? Code:
View Replies
View Related