why this string fails to check if a user does not enter any data in a field?
<%
' Declaring variables
Dim make, model, description, price, data_source, con, sql_insert
' A Function to check if a field is empty
Function ChkString(string)
If string = "" Then string = " "
ChkString = Replace(string, "'", "''")
End Function
' Receiving values from form
make = ChkString(Request.Form("Make"))
model = ChkString(Request.Form("Model")) and so on and so forth...
%>
I am writing a script that lets me brows the contents of a web server. The problem is the account that is running ASP does not have permissions to every folder. Don't ask me why ... I have no idea but it can't be changed.
What I would like to do is perform a check for:
Microsoft VBScript runtime error '800a0046':Permission denied
And if this happens display an error message saying they do not have permission to view this directory. Code:
How to re-write this so it can error check for each individual field. Username, email, password etc.
This is written and validates if the user already has an account in the Database. then it returns the messaage below. But I would like to indentify if it is the username that exist or the email or password. Code:
what would be the best way to error check a page after I clicked submit but before I go on. Example:
I have a page that dynamically puts text boxes & lists on a page depending upon which button I click on the main menu. What I want to do is check the text boxes for correct values (most likely before I go to the next page which is the Update page). But since I am dynamically creating the page & text boxes I don't know what the names are... I am doing the dynamic page through server side script.
This means that almost all my variables names and anything associated with the dynamic page are in the Server Side script and can't be reached by Client Side script. ok long story short which is best to error check a dynamic page before updating the info on that page. Server Side | Client Side script?
I'm setting up a simple competition entry system in ASP where users can enter their name and email address to be added into a prize draw. It's pretty simple stuff, with the data being added into an Access DB table.I've created an index on the 'email' field to stop the same person entering more than once (unless they have more than one address, but let's pretend that's never the case ).Instead of doing a SELECT query to find whether they've entered before, I simply want to attempt to INSERT the data into the table, and if it returns an error along the lines of "no duplicate values in the index" it would give the user an error.My question is, is it possible to display a user-friendly version of the standard ugly ASP generated error message when this error is detected? Or am I stuck with the incredibly unattractive error message we're used to?
i'm making a forum, and previously i was submitting the form to an asp file, which would check for errors -- if there were errors, it would redirect back to the form with error messages to be displayed -- if it was error free, the message would be written to a txt file.
but then i wanted to put in a preview message page, and so error checking and passing values between the three pages is becoming tricky. so i'm at the point where i'm starting to use javascript to error-check, which works fine for making sure the input is good, but i don't know a good way to notify the user that there are errors with javascript. alert messages are unprofessional, and i can't just add text to the page using javascript.
i'd prefer to use only asp, and i'd prefer it if i didn't have to use an extra asp page JUST to error-check. as it is now i have these pages involved in adding a new subject:
post subject (has the form for the subject and message; the user can click either post message, which will directly write the message, or preview message, which will bring them to a page which displays the post as it would appear once written)
preview message (regardless of what the user clicks, it would come here first to do error checking, and depending on what the user clicked it would either redirect to the page which writes the subject, or display the message;
the problem is, if there are errors with the form, i need to point the user back to post subject without losing whatever info they have already entered. the only way i know how to do that is by submitting a form [i can't use a querystring because it won't maintain the message if the user entered multiple lines in the message])
add subject (this does the backend writing of the message, and is only accessed if the fields have made it through the error-checking)
any solutions in mind on how to pass the field values between these three pages?? or is there a better way i can do error checking??
In Kevin Yank's book, he shows how to put in error checking at various stages of working with a database: connecting, querying, etc. I presume the same general principles apply to ASP/SQLServer but I don't know the code. Can someone tell me at what stages I should be checking for errors and some generic code that I could use at each stage?
I have this table that has two columns Department and RecId. what I am doing is I need to give access to different people in different departments. So if I am in billing I say billing 76 which is my rec id and than if I also need acess to accounting I say Accounting 76.
So now in my asp page I open this records set to check and see who has access to what departments and give them the access Code:
I want to check whether the value in recordset is "=> 3 ". I try "If rs => '3' then...". But it doesn't seems working. Can I can't check the condition by using the recordset like how i written above? Or do I need get the value in recordset and assign to a variable in order to check the condition. Please advice. Let say my rs now stores a value of "2". Can I check with the following code.
[code] set rs = server.createobject("...") rs.open "Select...", objconn
if rs >=3 then 'THIS LINE DOESN"T SEEMS WORKING .... [code]
I want to do some error checking using on resume next to determine whether to commit an ADO transaction. However we have a custom 500 error page which we use through out the rest of the site. Can I remove the on error resume next after I have rolled back the transaction and raise a normal error.
Is it possible to have an ASP page which checks if a user is in a certain group in Active Directory (AD). For example jbloggs is logged in and belongs to the group "project_allowed". When jbloggs goes to project.asp it will allow him access However when jsmith is logged in and belongs to no groups and tries to access project.asp it will deny him access.
The script is designed as a form validator which checks fields for various criteria and then sends a mail with the form contents. Since 40 different forms will be plugged into this script, there needed to be complete seperation between the two.
I've managed it so far by checking for required fields by putting the word 'required' into the name of the field. The script then sources out any fields which has this text and checks them to see if they are filled out.
The problem I've come across now is that I need to check for field length. My idea was to put the amount of characters needed into the name of the field in the form and then have the script check with a Reg Exp. However, Im not too sure of the regular expression needed to check for this.
Can someone suggest one? The one I have at the moment is [1-14] but say I had a field like this: <input type="text" name="passwordrequired12"> That would match bout for 1 and 12. Any ideas?
How can I check whether a variable is set as a value, integer, etc .. ??? (So that when a user submits a value via a web form and its a letter, i can give them an error note.)
How can I write an asp page, say, CHECKIP.asp that checks the incomin requesting IP address and returns a protected page, based on th checking result? That is, if the IP is a permitted address, the presents a page, say, OK.asp. If the IP is not allowed, then send REJECT.asp. Both OK.asp and REJECT.asp cannot be directly accesse without going through the CHECKIP.asp.
I am a somewhat beginner in ASP. I would like 2 know how do I check whether a recordset, that was fetched from an MS-ACCESS database through a 'SELECT' query, is empty or not?? The scenario is that I m making a form where users can register for my message board. The form will take in all the details and pass on to another asp file which checks whether the username is already in use or not. If its in use then it says that Username in use else the page is displaying error. I m using the following sql. "select * from members where user='" & username & "'"
The error is something like record cannot be found. Either EOF or BOF or the record was deleted.
I got the below code from somewhere ages ago. I have a list of links on my site that link to other sites but I want to check if the link is a valid link automatically and if it fails after x checks (checks every 7 days) then to mark the link as a possible broken link
the below seems to take ages to process and was wondering if there is a better way to do the below. Code:
i wanted some help in the bewlo subject i tried in different code but some time it is showing wrong error.is anybody give me the example or site linke where i can donwload the the password checking script from database. I have pulled data from database and shown those user name in suer tab ( drop dwon box) user need to select the his name and to type password.once user type the password it should check with database . if it exists then it should capture that user name and move on to next page.
I have a simple question. Can you check if a number has been passed through a form? For example I making a website for a property letting company and they upload the property themselves. But if you you put in text into the rent field, it throws up an error when adding to database obviously.I do validate the in put before adding it to the database so was thinking about another IF statement checking that a number was entered before they get as far as adding to the database and throwing up errors
A member logs on and enters a record, if one already exists for that date, then they get a message saying so. If not the record is added and some text is displayed. But it still allows me to enter records even if one already exists! is it because I am storing my dates as strings? Code:
How do i check the format of the field I am reading from a Excel table. I'm using a adodb connection to query an EXCEL/ACCESS table and display it on browser. Is there any way to check the format of a particular field that is bieng read.
For example how do i check whether a field that is read is in date format...?
I have a url containing query strings, e.g. http://domain/page.asp?one=VARIABLE
I would like to be able to check what the variable is, for arguments sake, the letter 'a' or the letter 'z'.I have sent the query string to this, stringone = Resquest.Querystring("one")
Then later on, I wanted to write different things depending on what the query string returned.
IF ---the stringone IS the letter 'a' THEN DO THIS ELSEIF -- the stringone IS the letter 'z' THEN DO THIS END IF
but i dont know how to check whether the string is = to the letter 'z' or the letter 'a'.
We need to spell check Text Areas in our ASP pages. We don't want to use MS Word. We are looking for an cost-effective, easy to configure and use, well-known COM-based Spell Checker component.
Is there a way to query a webserver to see how many, and which, ASP Session ID numbers are still current? (ie: not expired).I'm working on a way to track active Website visitors & wish to compare a Log of Session ID's against those that the Server would recognise as still active.
I need to send a user submitted (through my website using a javascript page) proposed company name to the Companies house database to see if the name is currently not being used by a uk Ltd comapany and therefore available.
I need to then return to my site yes or no, if yes then let them carry on with the comapny application, if no to give them a message suggesting an alternative. can someone steer me to a good tutorial for this please?
I use ASP to check users data they submit. In particular, I'm checking for credit cards and I also use a server component DynuCreditCard. It basically affirms that the number "could be" a real credit card number.
Anyway, I cannot get through the website without having a legit CC#. None of the handful of testers that help cannot get through without a legit CC#. About once a month some user gets through with a blank credit card field. How do you troubleshoot something like that? I can't replicate the problem. Do you just say... "oh well... there was a computer glitch"...? How can I approach this problem?
I have a script which loads picture url's (these are on a compeletely different server) from a table and displays them on my page along with the rest of the data. Unfortunately, the folks who supply the data for my table don't always have the correct url's in the picture column.
Does anyone know a way to ensure that there is actually something to display? I guess it would entail something along the lines of checking for a remote file? How do I do that?
I would like to inquire how would it be possible to use asp to check the format of the excel being uploaded? Like the first row in cloumn A is named Results, column B is named Example and so on.
I've already able to use asp to to extract the data from the excel and insert them into the access ab. Now I would like to know how to be able to check the format of the excel file being uploaded, if it is the way i want then it would proceed to insert the values into the access db, if not the user will be informed that the format of the excel file was not the standard one.