I am doing a reskin of an ASP site, MS SQL in the back end. I made a copy of the site and DB and am using them as my development site. Fine so far, but here's where it gets wierd. I am getting random ASCII characters throughout my text, not totaly random, for example a double quote will come back as ’. So they're consistant. This is both for data in a file, and data from the DB, but I'm fairly certain all of it is qwritten with Response.Write.
These two sites are in identical environments, on the same server, using the same DB (well a copy of one anyway)
I use ASP, but i dont think it matters. I am parsing large text files. some of them have non standard characters. I just want to parse a file and replace anything that is not found on a keyboard in usa. I just want to keep:
A-Z, a-z, 0-9, .,?'"!@#$%^&*()-_=+";:<>/|}{[]`~
everything else i want to remove (asian letters, wacky characters, etc)
I'm trying to catch some characters in a string before they are entered into a database that are not ASCII and convert them to ASCII characters. The characters in question are the angular double quotes but this could be associated with similar occurences. I want to check for left angular double quotes [“] or right angular double quotes [“] and replace them with straight double quotes ["].
(I'm not actually storing the HTML equivalents - they are simply there to give you an idea of which characters I'm on about.)a way of catching these buggers? I've tried using chr(8220) (the numeric code for one of the illegal characters apparently) but ASP has a problem working with numbers outside the character map.
basically what i have done is taken a date and time, split them apart, took the date array split that into 3 times via the / seperator now im trying to split the day number into 2.
(i.e if the day is 12 for example i want to split it so i get both 1 and 2 seperate, or if the day is 08 i would want to get 0 and 8 seperate).
Is there a way to split a number without some sort of seperator so i can get the first and second number of the day and if possible how?
I have a var with the value of ADED I want to be able to break this var into an array of 4 elements, or it could be three, depending on the value of the variable. I tried the following but got nothing. Code:
dim strVar, arrVar strVar = Request.QueryString("strVar")
i get the querysting like this: www.abc.com?email=abc@abc.com phone=33333333 Now i want to split this string so that i can just pass the phone number to the variable in my program so that the fax gets going.
Can you please let me know how i can split this string and just get the phone number to be passed to the variable ,so that i can initialte the next function of send fax?
I've made my first ASP website that interacts with a detabase. All fairly standard: it can display the entire contents of the db, you can input new items, update and delete items, and I've just started making a search page...[!] It all works fine if the user just searches with one word, but if they enter more than one word and then press search, I don't know how to split their searchstring up into [an array of?] different strings to search the db with. Is this even the easiest way to do it, or am I just wasting my time?
I have a very long string statement that needs spltting down into smaller sections and segments. I know how to use the split() function, and it splits the string down into smaller sections, however when I try and split one of these smaller sections into segments it throws an error out. Firstly is it possible to keep splitting the same string again and again to break it down? If not does anybody know how I would go about breaking down the string?
i have a search form that will only search the whole string when searching a query. i would like to have the search string split into separate words so that each word could be used as part of a single query. is there a simple solution to my question ?
I have several isbn's that are eather 10 or 12 charcters long. I need to insert a dot . after the fifth character if it is 10 long, and after the 6th character if it is 12 long. How do I count through the string and find out if it is 10 or 12 charaters long, then insert the dot . after the first 5 if it's 10, or after the first 6 if it's 12?
I know there is a way of stripping out special characters from a string however I need a way of stripping out "" marks from a string or what i really want is to replace all double ("") marks in a string with single ('') marks before inserting the string into a database. Is there a way of doing this in ASP?
But I can't find the same way to do it in vbscript using ASP! I simply want to strip the last four characters, but leave the rest of the string in tact! As the string could be any length, I don't know a start position.
I have this bit of code that stores the current web page address in a Session variable. I want to always remove the last four characters, such as E.asp, or G.asp, or I.asp.
I searched tutorials on string manipulation but all seem to take out a string in the middle of a string and replace it with something. I just want the last 4 characters removed.
I'm trying to strip out none alphanumeric characters (and a couple of punctuation marks) from a string before inserting into a database.
I've put in my code below, basically I thought I'd loop through each character in turn and pass it through a regular expression to check its validity. If it passes I'll add it to a global variable ('validString') if it fails I'll remove it.
But I can't get my Mid() function to accept 'i' as a value so it won't loop. Code:
what is the maximum number of characters that a string variable can hold - i initially thought it was 256, but after some testing it seems that it can hold much more than that..
I am trying to display records ( text and images) from a database. I get the text displayed but the image is displayed as a large series of Asscii text.
Connect.open "DSN=Rentals" 'declare sql statement that will query the database query = "Select * FROM RentalTable WHERE Location LIKE '%" query = query & Replace(request("varLocation"), "'", "''") & "%'" query = query & " AND PropertyType = '" & Replace(request("varPropertyType"), "'", "''") query = query & "' ORDER BY DateAvailable" RS.Open query, Connect
do until RS.EOF %> <table width="75%" border="1"> <tr> <td><%=RS("Address")%></td> <td><%=RS("Location")%></td> <td <% Response.ContentType = "image/gif" Response.BinaryWrite(rs("Image1")) %> </td> </tr> </table>........
Am trying to restrict user from entering non ASCII character in the text area. Say if the user entered non ASCII character then on the form post back it should show them the message like:
I am having a problem with getting my date to display in the format needed. The date is being called up from a database in the form of the date and time but I need to have the them both seperate from each other. Its for a message board app I'm currently developing. I've tried various methods but none have worked so far. I am using this code at the moment:
i need to write a query that splits forname and surname that are held in the same col of a db eg old form requested for name(so users just put sarah smith) but I have added another col forname in the db and the forms now collect forname and surnane into seperate field but I have to now split the old data and put ot into the separate fields can anyone point me in the right direction.
I have this SELECT box which allows users to select multiple items to delete... however if they select 2 or more items... the values get passed over as 'one, two' so the sql looks like Delete From Table Where Field='one, two';
Has anyone had the misfortune to try and split a querystring that has x duplicate name/value pairs within the querystring? I have tried every sort of combination to do this and it continues to just run through the whole querystring.
here is an example querystring
URL
The Address values, email values, title values are fine as they are named on the previous page. The problem is, the L1, L2, L3, L4, L5 etc are dynamically named from a db depending on what the user selects on a previous page and can be duplicated up to 6 times, depending on how many different locations they have. I am able to get all the values at once, but need to be able to split the duplicated name/value pairs as they at seperate locations.