Formatting Post Code String

I was wondering if someone could help me with a formatting problem for ASP/SQL?

Is it possible to format a variable string from a textbox?

I'll try and make it more clear what i want, sorry.

I have a page with a textbox and submit button for users to input a postcode, which then searches a database for matching or similar postcodes.

This is the query i am using: Code:

View Replies


ADVERTISEMENT

Formatting String

I have one string variable and value stores something
like this:

st = "From: ""John Thomas"" <john@test.com.au>"

when i test it display some thing like
From: "John Thomas" <john@test.com.au>

How can I pick up only display name and without double
quotes. i.e. it should display only

John Thomas

View Replies View Related

Formatting String?

I'm having a problem with the following:

I'm passing a query string from one script to the other via a hidden input.
Right now I'm just response.writing the query string out to make sure the
query is getting there.

The query string will display no problem if the query has no single quotes
( ' ) i.e. returns:
SELECT * from table WHERE int_field = 123 ORDER BY id

But when the query contains quotation marks to handle text it chokes, i.e.
returns:
SELECT * from table WHERE text_field =

when this should be:

SELECT * from table WHERE text_field = 'textvalue' ORDER BY id

I've tried various arguments with the REPLACE function, but can't get it to
work...

Running SQL2000.

View Replies View Related

Formatting String

I have one string variable and value is stored something like this when I checked using
Response.write st_toadd. It displayed something like this

"John Matthew" <john@abc.com.au>

I want to grab only email address i.e. value between "<" and ">" and it should give me only Join Bytes. what could be the syntax?

View Replies View Related

Color-code Formatting

I know php has some nice color-code formatting, where it will show the file in nice colors

(highlight_source..)

An example of what I am talking about is located here:

http://dev.zaireweb.com/source.php?source.php


Is there a way to do this in ASP

View Replies View Related

Formatting Date Incorrect Code

I have two dynamic listboxes.One is a date and needs formatting.I am using DWMX and therefore used the format function within the dynamic listbox wizard.When I run the page the listbox without formatting is ok, but the date listbox returns the following:

Microsoft VBScript runtime error '800a000d'. Type Mismatch 'DoDateTime' /admincontacts.asp, line 189

Line 189 is the following:

<option value="<%=(rsAdmin.Fields.Item("Date_Added").Value)%>" <%If (Not isNull(DoDateTime((rsAdmin.Fields.Item("Date_Added").Value), 1, 4105))) Then If (CStr(rsAdmin.Fields.Item("Date_Added").Value) = CStr(DoDateTime((rsAdmin.Fields.Item("Date_Added").Value), 1, 4105))) Then Response.Write("SELECTED") : Response.Write("")%> ><%=(rsAdmin.Fields.Item("Date_Added").Value)%></option>

View Replies View Related

Dfisplaying Long String Without Massing Up Formatting

i am stuck while trying to display a long string, its not just one string though, itsa field from a database that has a problem solution in it, most data is just how to stuff like:

"do this, install this and then restart and install the new stuff... etc."

but some of the solutions have long links to (for example) servers and there is then maybe 150 characters all in a line and no breaks to make the line break - this makes my table (390 pixels wide) get streched to hell on one side.

i have tried going through the code, counting the characters and then taking a "left" of code depending on how many groups of 50 there are but that breaks words in half and thats looks nearly as bad.

View Replies View Related

Formatting A HtmlBody Email String To Include Variables

I have this:

1 emailBody = "<html>" & vbCrLf _
2 & "<head>" & vbCrLf _
3 & "<title>Interpreter Request details</title> " &
vbCrLf _
4 & "</head> " & vbCrLf _
5 & "<body> " & vbCrLf _
6 & "<font face=Verdana><b>Interpreter Request
details: " & vbCrLf _
7 & "Requestor: </b><u> <% strFName strLName %></u>"
& vbCrLf _
...
& "</body> " & vbCrLf _
& "</html> " & vbCrLf

In line 7, I need to display the results of the variables strFName and
strLName (and have a space in between the two) but I don't know the proper
formatting. If I just use the & then I get the literal strFname instead of
the value. Could someone please show me the correct syntax for this?

View Replies View Related

Post Code

I am requesting a form field which has a UK postcode value eg yo17 9hs, or NE15 7YY. What I need to do is pull out just the first part of the postcode, in this case it will be yo17 and ne15. Anyone help me do this in asp?

View Replies View Related

Striping HTML Tags From String, But Leaving Paragraph Formatting

I have a string of HTML (used for a specific purpose) that I'd like to
use somewhere else but as plain text. Rather than introduce a
specifically created plain text version I'd like to strip the tags code
from the HTML version. This in itself is easy, using a function such
as:

Function HTMLDecode(Expression)
Dim sTemp
sTemp = Expression
sTemp = Replace(sTemp, "&gt;", ">", , , 1)
sTemp = Replace(sTemp, "&lt;", "<", , , 1)
'Repeat for each defined entity
HTMLDecode = sTemp
End Function

However, the difficulty comes when trying keep each paragraph seperate.
For example, the string "this is<p>my name" shows on screen as:

this is

my name

if I use the above function, it strips out the <p> tag and shows the
result on one line:

this is my name

I thought I could use something like:

str = replace(str, "<p>", chr(10))

but that doesn't seem to work. Can anyone help me replace <br> and <p>
tags with something that's recognised as "plain" text but will keep the
paragraphs and new lines formatted correctly??

View Replies View Related

Code For HttpWebRequest POST

Could someone post some clean code for a HTTPS POST request running from a
server to a 3rd party server in an aspx page.

I have some code that works unreliably. If I try the request from a few web
pages it will not work reliably.

I use ThreadPool.QueueUserWorkItem, myHttpWebRequest1.BeginGetRequestStream,
myHttpWebRequest1.BeginGetResponse.

Does Microsoft’s .Net SSL socket code use blocking sockets by the way?

View Replies View Related

HTTP Post - The Code...

i've got this code...

Dim oOriginalPO, oXMLHTTP, strFileName, strURL

strURL = "url that is required"
strFileName = sXML

Set oOriginalPO = CreateObject("MSXML2.DOMDocument")
Set oXMLHTTP = CreateObject("MSXML2.XMLHTTP")

oOriginalPO.async = False
oOriginalPO.load strFileName 'name of file containing cXML data

oXMLHTTP.open "POST", strURL, False 'strURL is our URL you post to
oXMLHTTP.send oOriginalPO

So on the assumption that the sXML variable has correct information inside it to send out, can anybody see why perhaps this code isn't working properly?

View Replies View Related

UK Post Code Strings

I have a bit of a problem with UK Post code strings, as you guys in the UK will know, our postcodes are alpha numeric.

LL12 4RS, C4 4GF, DG1 7HD etc etc...

What I need to do is grab the first letter(s) of the post code, ignoring the rest of it. Now, 'cos it can be either 1 or 2 (and in some weird cases 3) letters, I can't do a simple left() on it.I'm guessing something like a regexp will be the way to go? (but I'm a bit hazy on the reg exp thing)

View Replies View Related

Post Code Regexp

Some one has kindly supplyed me with this regexp to check all UK post codes:

/^([Gg][Ii][Rr] 0[Aa]{2})|((([A-Za-z][0-9]{1,2})|(([A-Za-z][A-Ha-hJ-Yj-y][0-9]{1,2})|(([A-Za-z][0-9][A-Za-z])|([A-Za-z][A-Ha-hJ-Yj-y][0-9]?[A-Za-z])))) [0-9][A-Za-z]{2})$/

The trouble is it looks for a space in the middle and i DONT want a space.I can't see the bit that does this

View Replies View Related

Post Code Search

I'm trying to work out how to do a post code search with longitiude and latitude, the idea is to be able to input yuor postcode and the search will return all company stores in that area.

View Replies View Related

Adding Manually To The POST String

I am a beginner in ASP and i have the following question: Is it possible to add manually things to the string that the page will send to the other page?

In other words: Do i have to use Form items to add something to the string?

My idea is:

<%Form=Form+"?Hgeheim="werkt"%>

it doesn't work. If it is possible could you please give a example code?

View Replies View Related

Collect String From HTTP Form POST

I have a basic form that POSTs data to a web server. The web server then replys with a string response. It goes something like this:

<FORM METHOD=POST ACTION="https://www.mywebserver.com/trans.dll">
<INPUT TYPE=HIDDEN NAME="x_Field1" VALUE="1">
<INPUT TYPE=HIDDEN NAME="x_Field2" VALUE="True">
<INPUT TYPE=HIDDEN NAME="x_Login" VALUE="MyUser">
<INPUT TYPE=SUBMIT VALUE="Click here To Submit">
</FORM>

The response is just a comma separated values string like:
1,0,2,3,0,Transaction Success,Etc

Once I hit the submit button the server returns a string response. I do not want the user to ever see the response, but need the response string to create my own page. How do I retreive that string and use it??

View Replies View Related

How To Pass A Long Parameter String To A ASP Page Via Post Parameters

I have the following test.asp page which needs one parameter querystr
but my querystr is a very long string value. When I send a long value
the query string is getting truncated after some characters.

Can you please kindly share the code segment to workaround how to pass
such a long string value to a asp page. This is how I invoke the test
page:

http://localhost/?querystr=select ............ from xxxxx

'test.asp
<html>
<body>

<%

response.write("Hello World!")
w=request.querystring("querystr")

response.write "<td><p></td>" & w
%>

</body>
</html>

but part of my query string never gets passed to the asp page appears
asp as a limitation on max string length can you please provide me a
workaround how I can overcome and pass the right string to asp.

View Replies View Related

Single Code String

I have a problem in inputing single code(') string into the SQL database. I wrote in ASP language and connect to the SQL server to insert the data.
If the data contains single code string (e.g women's group)the syntax error appears and it stops.
I tried to change the double code(")instead of single one to insert the data and then, it also has error "does not permit column name ...." or something like that.
How can i solve the problem to input the data that contains single code(')?

View Replies View Related

Isoleting A String Of Code

I want to write a script that will identify the string of code between two delimiters, in this case [ img ] and [ /img ]. I am using an image resize code that means i need to take the image URL and use it in two places. I need to turn:

[ img ]http://www.imageurl.com[ /img ]

Into this

<img src="http://www.imageurl.com" <%=ImageResize(Server.MapPath("http://www.imageurl.com"), height, width)%>>

So, just looking for thoughs on how to isolate http://www.imageurl.com,

View Replies View Related

Running ASP Code From A String

Can I run ASP code from a string? I thought of using this method to get included files as text http://www.asp101.com/articles/mich...des/default.asp but then I need to run it as ASP.

View Replies View Related

Need For Connection String To Be Included In The Code

got this code , among others (attached below) for shopping cart from a friend and it suppose to work, however it requires a connection string to make this database driven website works, so my question is how do I insert a connection string code in the string so that it will make a connection to the Access database. Code:

View Replies View Related

Re-submit A POST Immediately From A Previous POST

Is there a way to 'force' a submit on a form with out actually allowing the
user to press a button ? For example...

step1: A from is filled out by a user, then they click the submit button.

step2: The form is 'post'ed to an ASP page which writes the values to a
database. So far No problems. But..

step3: Now I want to 'post' these values again to another page without any
user interaction.

My ideas were:

1) I know you can get the form values from Request.Form("myVar"), so I
thought of making a 'dummy' form and setting the 'values' of the form
variables to these Request.Form("myVar") valiables, but I don't know how to
'submit' them to another page again.

2) Is there some type of 'submit' command in ASP?

View Replies View Related

Post Data, Then Post Again..

i have a series of .asp pages that i am dividing into model, view, control logic. my view collects a whole bunch of data and posts it to the controller. im wondering if there is a way to somehow "re-post" this same data to my model page.

in short, is .asp capable of taking data posted to a page and re-post that same data to another page?

View Replies View Related

Web Forms / HTTP File Upload / String.Split A StreamReader.ReadLine() String

I'm developing an Asp.NET system to take a CSV file uploaded via the web, parse it, and insert the values into an SQL database. My sticking point comes when I try to split() the string returned by readline() on the file.

The following code snippet works for me:
tokens = "one,two,three,four".Split(",")
for each token in tokens
response.write("<td>"+token+"</td>")
next

However, if I take the next line in the CSV, read using StreamReader.ReadLine on the PostedFile.InputStream, I receive "Object reference not set to an instance of an object." which I have narrowed down to be my string holding the line. Further investigation reveals that no other string member functions work on my line (.ToCharArray, .ToString, etc).

I suspect that StreamReader.ReadLine is not correctly returning a string, even though Response.Write(line) displays what I would expect .....

View Replies View Related

ASP Code - Anti Spam Verification Code

I'm looking for sample code that will require a use to enter a code from a scued image format.

I'm sure you've seen them before where the image is barely readable by a human and the user has to enter the code correctly to submit the form.

I'm looking for ASP code and NOT ASP.NET code as I am supporting a legacy site.

View Replies View Related

XML Formatting

I’m having an issue saving/reading an xml file.The source of this file is a the parameter of an object. Through the UI the user can change the value (xml string) of this parameter.

The problem is that the parameter needs the xml with > , < , and " instead of the > , < , " chars. However when I save it, the xml dom and even the fso save it with the actual xml chars. Other than a literal search, is there an easy way to convert the file to have the special chars?

View Replies View Related

ASP Formatting

Im looking for an online site that I can format or tidy ASP pages. If any one also knows of a software application that can format asp /html pages id be greatfull of that link too.

View Replies View Related

Tag And Formatting

I'm having users enter a message into a textarea, but I'm having problems with the formatting. How do I add " " characters where they have pressed enter?

This is being entered into a MySQL database, so I have already replaced the ' with '.

View Replies View Related

Formatting Variables

I am requesting a variable for the users' network username:

<%=Request.ServerVariables("LOGON_USER")%>

This returns the following:

NETWORKJ.Bloggs

Instead I would like it to return J.Bloggs on it's own with out the "NETWORK" bit so basically I am saying how do I cut out the first 8 characters of a variable.

View Replies View Related

Report Formatting

I have users typing in information into a text box. Sometimes this information can be lengthy and contain simple formatting such as spacess between lines and line numbering. For example:

1. List item number one

2. List item number two

I then have a report page that prints out this information. Unfortunately, the line spacing doesn't show up in the report. It's just all jumbled together. I'm just using <%= Notes %> to show the db field. Is there a way that I can show the formatting that was originally entered or do I need to use some kind of word processor like I am using to type this post?

View Replies View Related

Form Formatting In Asp

I would like to know how to format phone numbers and ssn numbers in textbox. That is when I enter the phone number, it is going to the database as 000,000,0000. I want to have it as either 0000000000 or 000-000-0000. Likewise, for ssn also. I am really fed up with javascript, somehow, it doesn't work well for me. Always, get page errors and it is not that easy to find out the errors in javascript.....

View Replies View Related

Date Formatting

i have a date in the following format: 12/1/2003

how do i reference just the 'day' portion of this date - in other words '1'

if the date was 12/10/2003, then i would just want the '10'

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved