Identify If Numbers Only In A String

in one part of my application i have some kind of user and password form. it asks for e-mail and a costumer id (as password), the costumer id must be a number, it's an INT in the SQL table. i tried to use a javascript checking method, but this kind of checking method seems not to work at all in firefox, so i'll do the checking via asp. what i need to know is how to check if a some VAR got anything except numbers in it?

View Replies


ADVERTISEMENT

Get Numbers In A String

Lets say i have these examples:

Example1: text12345.asp
Example2: text321.asp
Example3: text214412311123.asp

How do i get the number in the string.

In example 1, the output should be: 12345
In example 2, the output should be: 321
In example 3, the output should be: 214412311123

View Replies View Related

Generate Randomize Numbers Based On A String Of Text

i trying to randomize a string of text inc. number and alpha. e.g. 024053J

what is the approach to generate a few integer numbers from this string "024053J" ?

i tried to this way of randomize but not very efficient as in sometimes the user will get the same numbers back when the page is refresh.

So i thought to use a string of text to generate the randomize numbers.

randomize()
num_pmax=100
num_pmin=1
r2=Int((num_pmax-num_pmin+1)*rnd+num_pmin)

View Replies View Related

Identify Value With ASP

How to identify with ASP that value is a Numeric or Date or String ?

View Replies View Related

Identify What Link You Are On Using Asp

I have been using css to identify what link (page) the user is on by using body id. The site I am developing has alot of pages, so i am hoping this can be done easily using asp.

Here is an example of what I am after The user clicks on say Testimonials goes to the testimonials page and that link is highlighted.

View Replies View Related

Identify Duplicates In An Array

i have created an array from recordset containing user names eg. (davidp, davidp, evenf, patricka, rebeccah). which i have sorted in alphabetical order, but i need to
identify duplicates in this array and the number of times it has been duplicated.

View Replies View Related

Identify User Type

If I have two different kinds of users on my website say simple posters and moderators, how do I differentiate between the two on my site while they move from page to page. I mean, I cannot append the user type ids with the web address to transfer the value from page to page since anyone wold be able to alter it. If the value is accessed from the DB every time a user requests for a page, then the program will become inefficient, wouldn't it?

View Replies View Related

Identify A Unique Visitor

We've created a video application that allows "voting" for videos, to determine prize winners. We want to restrict each computer to one vote per day. What is the best way to do this without requiring the user to log in? A login app is not in the client's budget, nor is it doable from a time standpoint. Is detecting IP address in ASP reliable for the average user? Cookies seem easiest, but they also are easy to wipe out.

View Replies View Related

Writing Code To Identify

I need to write some special logic in my ASP.NET page. If the page is visited by a human visitor, I want to show an advertisement. If the hit is from any search engines, I do not want to show the Ad.

How can I identify if the hit is from a human visitor or search engine? Is there a server variable I can compare with the list of available search engine names?

View Replies View Related

Identify If A Process Is Running

does anyone know of a way to check if a process is running on the server... using asp ? I basically have an html form and upon submittal of the form ... i would like to redirect to the response page when a certain process is no longer running . the logic is as follows Code:

1) user enters form values and clicks submit button
2) server side asp checks the server for a process "wpuba.exe"
3) if "wpuba.exe" is not running .. redirect to page2.asp

basically I want to wait for the "wpuba.exe" process to terminate before redirecting to the response page.

View Replies View Related

Identify Which Session Variable Expire

i have 2 application variables called totalAdminLoggedIn and totalUserLoggedIn

when ever an admin login, I increment the totalAdminLoggedIn value by one
and when a normal user logg in, the totalUserLoggedIn value will be incremented by one.


how can i change the values when the session expire ? i can reduce the value manually when they logoff like:

if session("userCategory")="admin" then
Application("totalAdminLoggedIn")=Application("totalAdminLoggedIN")-1
elseif session("userCategory")="user" then
Application("totalUserLoggedIn")=Application("totalUserLoggedIn")-1
end if
session.contents.remove "userCategory"

but what if the session expires automatically or if they close the window suddenly?

ie. i want to do something like below? Code:

View Replies View Related

Identify Login User Identity

I am doing a webpage which allows different users from various departments to do a search/print information of people within their own department. I have a login page for user to key in the correct password and id before they enter the system. However, in order for the restriction to take place, I will have to ensure that the system recognises the person that is logged into the system.

View Replies View Related

English Numbers Into Arabic Numbers

I'm working on asp project, access 2000 at backend.I can write arabic text and arabic
numbers in textbox and save them in database.but if i see these records, arabic text and arabic numbers,it is ok,if my computer is arabicenable.

If my computer is not arabic enable then it show arabic number into english numbers.
how can i show arabic numbers instead of english numbers if my computer is not arabic
enable.i'm working on a project i have to complete it.How can i convert english numbers that are coming from database and convert that numbers in arabic for show.

I have use

<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
I shall be very thankful to you for this purpose.

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

Getting Two Numbers

Just started learning ASP about ten minutes ago.
Currently experimenting with forms.
could someone please tell me what is wrong with this code:Code:

<%
Resonse.Write Request.Form("myform") + Request.Form("myform2") & "<br />"
%>

Im trying to get two numbers to add together from a form.
I get this error when i use that code:
Quote: Microsoft VBScript runtime error '800a01a8'

Object required: ''

/Jaynesh/asptest.asp, line 14

View Replies View Related

Even Numbers

how can i check if a variable is an even number

View Replies View Related

Add Two Numbers

i want to add two numbers in server script with VB script. how to do it.

View Replies View Related

Add Numbers Using Checkboxes

I Have this form in page1:

<form method="post" action="page2.asp">
<input type="checkbox" name="numb" value="10">
<input type="checkbox" name="numb" value="20">
<input type="checkbox" name="numb" value="30">
<input type="checkbox" name="numb" value="40">
</form>

Now what I want is to add the checked values in page2.

For example :

if checkbox1 and checkbox3 gets checked I want to add the values in the
checkboxes which in this case is 10 + 30 and get the total sum (40).
Hope this makes sense?

So how do I retrive the checked values and then add the checked values
with eachother to get the total?

View Replies View Related

Ordering Numbers?

i need to oredr a set of numbers. the numbers are "06/9","95/1","95/6","06/3" and so on. the thing is that these need to be ordered form the second number, so it shoudl be ordered thus: "95/1","06/3","95/6","06/9". how can i do this? at the moment just as an attempt im splitting the number either side of the "/" like this:

var regNo = "12/09"
var yearStart = 0
var yearEnd = regNo.indexOf("/")
var year = regNo.substring(yearStart, yearEnd)
var itemStart = regNo.indexOf("/") + 1
var itemEnd = regNo.length
var itemNo = regNo.substring(itemStart, itemEnd)

but where do i go form here?

View Replies View Related

Trim Numbers

I am converting bites to Megabytes in an operation. How would I trim the result to only go to 2 decimal places?ex:

Response.Write(file.FileName & " (" & (file.Size/1048576) & "Mb)<BR>")

View Replies View Related

Check This Numbers

i know how to code it in javascript but failed to do it in asp. there are 12 digits of number. exmple like this 871205106599. i want to check every single digit when user clicks Submit button.

View Replies View Related

Round Numbers To 0

I want to round numbers to include a 0 at the end.

response.write "<td bgcolor=white align=center class=menuText>" & 100 - Round(CTASCAvail,2) & "%</td>"
response.write "<td bgcolor=white align=center class=menuText>" & 100 - Round(Avail,2) & "%</td>"

the following code will round the numbers 2 decimal places but if it is a 0 it will not display it.

View Replies View Related

Addition Of Two Numbers

how to add two numbers from two different textboxes and display it in the third box.

View Replies View Related

Ensure Only Numbers

I believe this is possible using Regular Expressions (which I have never used), but I am unsure of any other way to do it.
Either method would be acceptable for me - I need to learn how to use Regular Expressions some day
How do you ensure that only numbers are entered into an input field.
I need to know this for things like postcodes, phone numbers etc. and a few other things and I've never come across an easy way to do it

View Replies View Related

Encrypt Numbers

Can RSA encrypt a sequence of numbers and letters intermingled together.
I was told that RSA can only encrypt letters,i'm not so sure. So can it bge done

View Replies View Related

Listing Numbers

I have 2 textboxes - "from" & "to".

Assume I enter number 1 in "from" and 10 in "to" - I want the ASP to return:
1,2,3,4,5,6,7,8,9,10 and insert this into an Access database over 10 rows
into the 'number' field.

Anyone got any ideas how to do this?

View Replies View Related

Adding All Numbers

regarding adding or getting sum all of the numbers in the database fields
example of the Fields:

Totay_Payment
10.00
20.00
30.00
40.00

My problem is i cant display the exact SUM of all numbers and it goes like this 10.0020.0030.0040.00 and i want the exact sum like this 100.00

heres the example of my script :

inTotalPayment = rsSumNumber("Total_Payment")
Do While Not rsSumNumber.EOF
intSum = intSum + intTotalPayment
rsSumNumber.MoveNext
Loop
Response.Write(intsum)

View Replies View Related

Random Numbers

I have a problem creating random numbers. I basically have this

Randomize()
iRandom = Int(10 * Rnd + 1)

If I do not wait a few sec before hitting the page again it will create the same random number as generated a few seconds before.Any idea why it is like that? Another way to reprocess the "bug" is to just fit F5 few times in a row and you end up with the same number being generated. Its annoying and I need some help to "fix" it!

View Replies View Related

Random Numbers In C#

I am trying to generate a random number between 1 and 100 into a label, using c#....

View Replies View Related

Regexing Through Numbers?

In our database I have various phone numbers, and they could start with 082
/ 083 / 084 / 072 / 073 / 074. How do I check any of these and change them
to 2782 / 2783 / 2784 / etc etc?

View Replies View Related

Version Numbers

I've got an ASP app. This app is deployed to two seperate Windows NT machines which I believed were the same. Unfortunately, the app works on one PC, but on the other I get some EOleExceptions from the COM object I use with the page.

Does anyone know how I can check versions numbers of things like what ASP engine I am running (if there is such thing), version numbers etc. etc.

I'm just looking for anyway of telling what the difference is between the two PC's.
P.s. I know this isn't really a 100% ASP based question, but I thought I would get a fast answer on the ASP board.

View Replies View Related

Split Numbers!

The number '60' can be written as (50+10) or (25+35) or (15+45) or (7+53) etc... but I want the output as (50+10) only when 60 is typed in a textbox & the Form is submitted. How do I do this?

View Replies View Related

Decimal Numbers

i have the following equation:

<%
avg_score = total / count_match
%>

what can i do to restrict the result of avg_score to be of 2 decimal places?

View Replies View Related







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