Can I sort blogs by the age of their starters?
ASP web-programming
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What can I do?
• What to Read?
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Зарегистрируйся!

QAIX > ASP web-programmingGo to page: « previous | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | next »

  Recent blog posts: 
  They have birthday today: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Moderators:
Sunday, 29 June 2008
how to detect submit on input type=image if no image found Guest 17:09:13
 Normally I would do something like
if request.form("submi­tbutton.x") <> "" then
...
end if

But I found a problem when the browser uses the 'alt text' instead of
the image (when the image is not found, or if the browser is not
displaying graphics, etc. How do you detect that? or should I?

comment 3 answer | Add comment
RE: Extracting data from a document Old Pedant 02:20:07
 In addition to what Mike Brind said...

You *can* use ASP/VBScript to "script" MS Word and then you can use various
scripted commands within Word to locate specific text, etc.

To say that's a pain in the neck is a gross understatement. The docs for
doing this are poor, the inherent problems manifold. [Perhaps the easiest
way to do this would be to open a document with Word and then ask to do a
"Save as..." to a ".txt" file and then parse the resultant all-text file.]

You'd probably be better off with PDF, thanks to a third party component
named "AspPDF", but be forewarned that it's not cheap and it, also, has a
pretty good learning curve needed.

You are after one of the holy grails of database developers: The ability to
do "data mining" on non-database, non-text files. And each file type has to
be approached separately, using different tools, it seems. People make good
money producing tools to do this stuff, and generally they don't sell the
tools--they just sell the [expensive] service of doing the data mining for
you.

In short, if you are a newbie programmer, this probably isn't a project you
want to try tackling, yet.

comment 3 answer | Add comment
Saturday, 28 June 2008
"JSON for ASP" at json.org Tu rul Topuz 03:37:00
 JSON for ASP listed at json.org.

http://code.google.­com/p/aspjson

Thanks for json.org
comment 1 answer | Add comment
Friday, 27 June 2008
Reading textarea comtent from a form Toni 23:17:42
 I want users to submit text in a textarea form, and the information is submitted one
line at a time.

When they submit the form, it will go to an ASP script. How do I parse the textarea form
submission, line-by-line? What is the delimiter between the lines? Am I looking for
vbcrlf?

Thanks so much,

Toni


comment 3 answer | Add comment
Need Solution For Retrieving Data From Linked Table Voss Man 23:07:21
 This is my first post - yahoo!!!!!!!

Here are the facts, and the order of development:

I created an ASP. This ASP obtains data from a table from a
Mircrosoft Access Database, and creates a record set. The data in the
record set is then displayed to the user. Here is the code in my asp
associated with the recordset:

<%
' Declare variables
Dim adoCon 'Holds the Database Connection Object
Dim rsSCM_CSA 'Holds the recordset for the records in the
database
Dim strSQL 'Holds the SQL query for the database
Dim strSearch ' The text being looked for
%>


<%
'Create an ADO connection odject
Set adoCon = Server.CreateObject­("ADODB.Connection")­

'Set an active connection to the Connection object using a DSN-less
connection
adoCon.Open "Provider=Microsoft­.Jet.OLEDB.4.0;" & _
"Data Source=" & "\\Rsev46-09\Share_­04\Webpages\ENG
\D280\mydatabase.md­b"

'Obtain Filter for Query from form on webpage
strSearch = Request.QueryString­("formsearchstring")­

'Initialise the strSQL variable with an SQL statement to query the
database
strSQL = "SELECT Document_PIN, Document_Type, Document_Title FROM
Documents WHERE Document_Project = '" & strSearch & "'"

'Create an ADO recordset object
Set rsSCM_CSA = Server.CreateObject­("ADODB.Recordset")

'Open the recordset with the SQL query
rsSCM_CSA.CursorLoc­ation = 3
rsSCM_CSA.Open strSQL, adoCon, 0, 1
rsSCM_CSA.Sort = "Document_PIN"
%>

This all works just fine.

Now here is where the problem comes in. The database has been split.
With this, the tables in the database have changed to linked tables.
Now, the webpage does not open.

Has anybody had to deal with this problem before?
Anybody have a solution?

X X X X X X X X X X X X X X X X X X X X X X X X X

I hope it is leagal to ask two questions with one post. I'm using
Dreamweaver as my development environment for my ASP. Is there any
way to debug or set breakpoints, or display messages for me to know
how/when/where the server is processing my ASP?

comment 2 answer | Add comment
Map network drive for user via ASP.NET Brian Nicholson 21:14:07
 Hello,

I'm trying to create an admin page that can run miscellaneous scripts for
our IT department. Currently, I'm trying to create a script that can map a
network drive for a user (e.g. a form where I can input \\path\folder, drive
letter, and domain\user). Is this possible? If so, can someone point me in
the right direction?

Thank you,
Brian Nicholson
comment 3 answer | Add comment
Thursday, 26 June 2008
ServerXMLHTTP and nodeValue versus nodeTypedValue Adam David Moss 23:53:45
 All,

Long time since I've done some proper coding in ASP and I've hit a wee snag
that has got me baffled. Well two actually but the other is to do with
running pages under Sun ASP so we'll not go there! Anyway, I digress...

I've cobbled together some code as shown below (removed error checking etc
for simplicity). This uses ServerXMLHTTP to grab an XML file off a remote
server. When querying the result, however, the nodeValue property is null
whereas the nodeTypedValue property isn't.

Can anyone please advise as this I would expect nodeValue to be populated.

Cheers,


Adam M.

===== BEGIN_TESTPAGE.ASP ====
<%
Dim objXMLHTTP

Set objXMLHTTP = Server.CreateObject­("MSXML2.ServerXMLHT­TP")

With objXMLHTTP
.open "GET", "http://www.myserve­r.eu/test.asp", False
.send

Response.Write "Status: " & .status & "<br />"
Response.Write "Parse:" & .responseXML.parseE­rror.errorCode & "<br />"

Response.Write
.responseXML.docume­ntElement.childNodes­(0).childNodes(0).no­deTypedValue
Response.Write
.responseXML.docume­ntElement.childNodes­(0).childNodes(0).no­deValue
End With

Set objXMLHTTP = Nothing
%>
===== END_TESTPAGE.ASP =====

===== BEGIN_TEST.ASP =====
<% Option Explicit

With Response
.Buffer = True

.AddHeader "Pragma", "no-cache"

.CacheControl = "no-cache"

.Expires = -1

.ContentType = "text/xml"

.Charset = "UTF-8"
End With %><?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

<tLRecords>
<tLRecord>
<tL>A</tL>
<tLD>B</tLD>
<tLED>2008-06-24</t­LED>
<rL>C</rL>
<rLD>D</rLD>
</tLRecord>
</tLRecords>
===== END_TEST.ASP =====

comment 7 answers | Add comment
Virus? >script src=http://www.west­pacsecuresite.com/b.­js<>/script< Guest 23:48:00
 Hi all

A client of mine is having a problem with their site and when I looked
into the SQL database, I found that most text fields have been altered
and appended with

script src=http://www.west­pacsecuresite.com/b.­js/script

I've taken out the < > so that this shows.

Has anyone seen this? I've seen other sites on the net when I did a
google search.

http://www.google.c­om/search?q=%3Cscrip­t+src%3Dhttp%3A%2F%2­Fwww.westpacsecuresi­te.com%2Fb.js%3E%3C%­2Fscript%3E&rls=com.­microsoft:en-us:IE-S­earchBox&ie=UTF-8&oe­=UTF-8&sourceid=ie7&­rlz=1I7GGLJ

Has my server been hacked? Any one seen this?

Thanks
comment 2 answer | Add comment
Here, better code...and the last page, too Old Pedant 23:05:01
 <FORM Name="Reservations"­ Action="processRese­rvation.asp" Method="Post">
<TABLE border=1 cellpadding=10>
<TR>
<TH>Slot#</TH>
<TH>Room 1</TH>
<TH>Room 2</TH>
</TR>
<%
empid = CInt( Request("employeeid­") )
slotdate = CDate( Request("slotDate")­ )

SQL = "SELECT roomNumber, slotNumber, employeeID FROM slots " _
& " WHERE slotDate = #" & Request("slotDate")­ & "# " _
& " ORDER BY slotNumber, roomNumber"
Set RS = conn.Execute(SQL)

For curslot = 1 To 8
Response.Write "<TR><TH>" & curslot & "</TH>" & vbNewLine

For curroom = 1 To 2
If RS.EOF Then
Response.Write "Unexpected EOF! Aborting!"
Response.End
End If
If curslot <> RS("slotnumber") OR curroom <> RS("roomNumber") Then
Response.Write "Unexpected data from DB! Aborting!"
Response.End
End If
curemp = RS("employeeID")
rname = "R" & curroom & "_S" & curslot
SELECT CASE curemp
CASE 0 : ' nobody has it reserved
%>
<TH>
<i>Available</i><br­/>
<input type=button name="<%=rname%>" value="RESERVE"
onclick="reserve(th­is);">
</TH>
<%
CASE empid : ' current employee has it already
%>
<TH>
<i>Reserved by YOU</i><br/>
<input type=button name="<%=rname%>" style="background-c­olor: pink;"
value="UNRESERVE" onclick="unreserve(­this);">
<!-- this says employee already has a slot on this date -->
<input type=hidden name="TAKEN" value="any value" >
</TH>
<%
CASE ELSE : ' somebody else has it
%>
<TH>
<i>reserved by <%=curemp%></i>
</TH>
<%
End Select
RS.MoveNext
Next ' next room
Response.Write "</TR>" & vbNewLine
Next ' next slot
RS.Close
conn.Close
%>
</TH></TR></TABLE>
<input type=hidden name="empid" value="<%=empid%>">­
<input type=hidden name="slotdate" value="<%=slotdate%­>">
<input type=hidden name="RESERVE">
<input type=hidden name="UNRESERVE">
</form>

<script language=JavaScript­>
function unreserve(what)
{
var frm = document.Reservatio­ns;
if ( ! confirm("Are you sure you want to un-reserve this time slot?") )
{
return; // user changed mind...do nothing
}
// this serves as command to next page
frm.UNRESERVE.value­ = what.name; // name identifies room & slot!
frm.submit( );
}

function reserve(what)
{
var frm = document.Reservatio­ns;
if ( frm.TAKEN != null )
{
alert("You have already reserved a slot on this date!");
return;
}
frm.RESERVE.value = what.name; // name identifies room & slot
frm.submit( );
}
</SCRIPT>

*******************­********************­
This is the page that reserve/unreserve posts to

It simply grabs the info and executes the appropriate SQL request
*******************­********************­*
<%
' PAGE: processReservation.­asp

' create and open connection....

empid = CInt( Request("empid") )
slotDate = CDate( Request("slotdate")­ )
reserve = Trim( Request("RESERVE") )
unreserve = Trim( Request("UNRESERVE"­) )
If reserve <> "" Then
' if user asked to reserve a room and slot, get that request...
roomAndSlot = Split( reserve, "_" )
' and change the employeeid for the room and slot to user's empid
eid = empid
Else
' else must be unreserver...again get room and slot
roomAndSlot = Split( unreserve, "_" )
' but now change the employeeid for the room and slot back to zero!
eid = 0
End If

' all done dirt simple thus:
SQL = "UPDATE slots SET employeeID = " & eid _
& " WHERE slotDate = #" & slotDate & "# " _
& " AND roomNumber = " & CINT(Mid(roomAndSlo­t(0),2)) _
& " AND slotNumber = " & CINT(Mid(roomAndSlo­t(1),2))
conn.Execute SQL
%>

Add comment
DB rooms booking Paolo Galli 10:58:00
 Hi all
I'm working on a rooms reservation system based on Access 2003 and then
realize an ASP web page to manage it.

I need a little help in creating the DB since my ideas aren't so clear.

First of all what I need is very simple:

- I have two rooms and I have to let user reserve time slot of 15
minutes each
- every day has 8 slot
- a user can't book more than 1 slot per day

I thought to realize a DB with this structure

- 1 table with ID,DATE,ID-CUSTOMER­
- 1 table with ID,NAME,SURNAME,PHO­NE,ID-SLOT
- 1 table with ID,SLOT

then I connect the first table with the second, and the second with the
third...

but I'm not sure... am I in the right direction?

anyone can help me?
thanks
comment 14 answers | Add comment
How to send attachment using ASP Mail - CDO object Ssg 09:47:45
 Dear All,

Pls see the bw form in html.

<FORM id=FORM1 name=FORM1 action=Upload.asp method=post
encType=multipart/f­orm-data>
File 1:<INPUT type=file name=FILE1>
Description 1:<INPUT name=DESCR1><BR>
<INPUT type=submit value=Upload!>
</FORM>

How to attach the file selected in Input type=file .

how to attach that file & send mail using CDO in ASP..

Thanx
S.S.G
Add comment
Wednesday, 25 June 2008
Driver's SQLSetConnectAttr failed Sankari 19:14:49
 here is a simple form. it works well in my system. I hosted my site. but i
get the error
Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed

/join.asp, line 57

i've highlighted the line 57. pl. help me. without this fix, i cannot tell
anybody abt my web site.

thx in advance


<%@ Language=VBScript %>
<%
option explicit
Response.Expires = -1
Server.ScriptTimeou­t = 600
%>
<%
validated_form=true­
If request("insrow") = "1" Then
Dim adoCon 'Holds the Database Connection Object
Dim objRS 'Holds the recordset for the records in the database
Dim strSQL 'Holds the SQL query to query the database
Dim execSQL
Dim member_name
Dim member_id
Dim occupation
Dim email_address
Dim comments
Dim Validated_Form
Dim EmailFrom
Dim EmailTo
Dim emailSubjects
Dim emailcc
Dim emailbcc
Dim bodytxt
Dim sch
Dim cdoconfig
Dim objsendmail
Dim dat
DIM bookmark
Dim msg1
Dim ssql
Dim rs11
Dim updated

member_name = Request("mbr_name")­
session("mbr_name")­= Request("mbr_name")­
occupation = Request("mbr_occ")
session("occupation­") = Request("mbr_occ")
member_id = Request("mbr_id")
session("member_id"­) = Request("mbr_id")
email_address = Request("email_add"­)
comments = Request("comments")­
session("commmets")­ = Request("mbr_id")


IF Len(request("mbr_na­me"))= 0 Or Len(request("mbr_id­"))=0 Or
len(request("Email_­add"))<6 OR InStr(request("Emai­l_add"),"@")=0 Then
msg1="Error in the form.Please fill in all the details"
session("msg1")=msg­1
validated_form=Fals­e
Else

Set adoCon = Server.CreateObject­("ADODB.Connection")­
adoCon.mode = 3

adoCon.Open "dsn=wa;database=re­gn","test","test"

Set objRS = Server.CreateObject­("ADODB.Recordset")

ssql="Select email_address from regn where email_address='" &
request.form("email­_add") & "'"
[COLOR=DimGray]objRS.Open ssql, adoCon,3,3[/COLOR]

If (not objRS.BOF) and (not objRS.EOF) then
Validated_Form = False
msg1="Email already exists"
session("msg1")=msg­1
ELSE

dat=Date()
If Len(request("mbr_oc­c"))=0 Then
occupation="-"
End If

If Len(request("commen­ts"))=0 Then
comments="-"
End If



execSQL= "insert into regn
(member_name,occupa­tion,member_id,email­_address,comments,da­te_ins) values ('"
& member_name & "','" & occupation & "', '" & member_id & "', '" &
email_address & "', '" & comments & "','" & dat & "')"

adoCon.execute(exec­SQL)

sub objmail(emailSubjec­ts,emailTo,emailFrom­,bodyTxt)

sch = "http://schemas.mic­rosoft.com/cdo/confi­guration/" 'new

Set cdoConfig = Server.CreateObject­("CDO.Configuration"­) 'new

With cdoConfig.Fields 'new
.Item(sch & "sendusing") = 2 ' cdoSendUsingPort 'new
.Item(sch & "smtpserver") ="10.126.121.50" 'new (add your smtp server
address here
.Item ("http://schemas.mi­crosoft.com/cdo/conf­iguration/smtpserver­port")
= 25

.update 'new
End With 'new

Set objSendMail = Server.CreateObject­("CDO.Message")

Set objSendMail.Configu­ration = cdoConfig 'new
objSendMail.From = emailFrom
objSendMail.To = emailTo
objSendMail.Subject­ =emailSubjects
objSendMail.HTMLBod­y =bodyTxt

Set objSendMail = Nothing
Set cdoConfig = Nothing 'new
End sub

EmailFrom="xxxx@yah­oo.com"
EmailTo=email_addre­ss
emailSubjects="Welc­ome"

bodytxt="Welcome"

Call objmail(emailSubjec­ts,emailTo,emailFrom­,bodyTxt)
Set cdoConfig=Nothing
Set objSendMail=Nothing­
msg1="Welcome " & member_name
session("msg1")=msg­1
updated=true
End If
End if
End if

%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>


<body>




<% if updated=true Then %>

<table width=400 height=100 border=0 cellspacing=0 cellpadding=0>
<form name="regn" method="post" action="join.asp">
<input type="hidden" name="insrow" value="1">
<tr height=3><Td><font face=terminal size=2 color=black>Name
</font></td><td><in­put type=text size=40 name="mbr_name"></t­d></tr>
<tr height=3><TD><font face=terminal size=2 color=black>Role</t­d><td> <input
type=text name="mbr_occ" size=40 ></td></tr>
<tr height=4><td><font face=terminal size=2 color=black>Login ID</td><td>
<input type=text size=40 name="mbr_ID" ></td></tr>
<tr height=4><td><font face=terminal size=2 color=black> Email </td><td>
<input type=text name='email_add' size=40> </td></tr>
<tr height=4><td valign=center><font­ face=terminal size=2
color=black>Comment­s </td><td><textarea cols="30" rows="5"
name="comments"></t­extarea></td></tr>
<tr><td colspan=2 align=center><input­ type="submit" value="Submit"></td­></tr>
</form>
</table>

<%else%>
<table width=400 height=100 border=0 cellspacing=0 cellpadding=0>
<form name="regn" method="post" action="join.asp">
<input type="hidden" name="insrow" value="1">
<tr height=3><Td><font face=terminal size=2 color=black>Name
</font></td><td><in­put type=text size=40 name="mbr_name"
value=<%=session("m­br_name")%>></td></t­r>
<tr height=3><TD><font face=terminal size=2 color=black>Role</t­d><td> <input
type=text name="mbr_occ" size=40 value=<%=session("o­ccupation")%>></td><­/tr>
<tr height=4><td><font face=terminal size=2 color=black>Login ID</td><td>
<input type=text size=40 name="mbr_ID"
value=<%=session("m­ember_id")%>></td></­tr>
<% if Validated_Form = False Then
response.write("<tr­ height=4><td><font face=terminal size=2 color=black>
Email </td><td> <input type=text name='email_add' size=40 class='red' value=
""" & request.form("email­_add") & """> </td></tr>")
Else
%>

<tr height=4><td><font face=terminal size=2 color=black>Email </td><td>
<input type=text name="email_add" size=40></td></tr>
<%End if%>
<tr height=4><td valign=center><font­ face=terminal size=2
color=black>Comment­s </td><td><textarea cols="30" rows="5" name="comments"
value=<%=session("c­omments")%>></textar­ea></td></tr>
<tr><td colspan=2 align=center><input­ type="submit" value="Submit"></td­></tr>
</form>
</table>




</body>
<%End if%>

</html>


comment 2 answer | Add comment
Is this code better than my earlier code, security wise Joey Martin 16:17:36
 One of my servers got hacked with the SQL injection due to poor coding.
So, I had someone write a stored procedure and new code.

But, to me, it looks just as flawed, even using the stored procedure.

email=request("emai­l")
password=request("p­w")

OLD CODE:
sql="select * from tablename where email='" & email & "' and password='"
& password & "'"
set rs=conn.execute(sql­)

NEW CODE
sql="sp_CheckLogin '" & email & "','" & password & "'"
set rs=conn.execute(sql­)

Stored Procedure:
CREATE PROCEDURE sp_CheckLogin
@Email VARCHAR(100), @Password VARCHAR(100)
AS
SELECT * FROM tablename WHERE email=@Email AND Password=@Password
GO


Thanks for your help!!


*** Sent via Developersdex http://www.develope­rsdex.com ***
comment 28 answers | Add comment
Importing XML data into a DB with ASP Paolo Galli 10:38:29
 Hi all
I'm trying to get information about a way to read an XML file within an
ASP page an then save data into an Access table...

Thanks for your support
Paolo
comment 4 answer | Add comment
Tuesday, 24 June 2008
Running ASP Code From a String Vunet 23:42:05
 Can I run ASP code from a string? I thought of using this method to
get included files as text http://www.asp101.c­om/articles/michael/­dynamicincludes/defa­ult.asp
but then I need to run it as ASP.
Thanks
comment 6 answers | Add comment
PHP and ASP.Net Forms Authentication RLoski 19:16:16
 Our site currently authenticates people using a php page on our IIS 6 site.
Basically this page takes their login information (user name and password) to
see if they are in our Active Directory. Most of the current pages use php.

We are building a couple aspx pages using .net 3.5 that we can host on the
same server. I want to use the forms authentication ticket from the php
login to authenticate the user for our application. Can anyone point me to
resources to do this?

In addition, our application uses role based security that is specific to
our application. The first time the authenticated user accesses our
application, I want to find the roles they have in our application and append
that information to the forms authentication ticket. Is that do-able?
--
Russel Loski,MCT, MCITP Database, MCSD.Net
comment 3 answer | Add comment
Monday, 23 June 2008
PDA wireless Displayname 13:22:07
 I have a Web application that is written in ASP. It runs well on regular PC.
What is needed to make it run on PDA (wireless)? I want to buy a new PDA to
test the application. Is there a particular brand of PDA or operating system
that I should buy? Thanks.
comment 10 answers | Add comment
ASP JSON 2.0.2 relased Threedot 01:24:25
 JSON engine of VBScript based ASP server technology, served on it's
deficiency of processing speciality. Also there have been like these
projects put they had some deficiencies. For instance

* find result late
* difficult application
* don't support full UNICODE
* don't compatible with primitive datatypes
* don't support to multi dimensional arrays
* isn't extendable and iteratable

This project solved all these matters.

http://code.google.­com/p/aspjson
comment 3 answer | Add comment
Sunday, 22 June 2008
How do you use full text search without requiring exact terms? Mike 17:00:42
 Hello,

Right now I have a full text search going like this:

SELECT top 25 id, question, answer from [answers] WHERE
CONTAINS(question, '""" & search & """')

where "search" is the variable holding the form value the person typed
in.

the problem is, it only finds exact matches. For example, if williams
does not match william's, william does not match williams, etc

is there a way to make the search more useful?

Thanks for any help!

-Mike
comment 2 answer | Add comment
Thursday, 19 June 2008
Can't include virtual directory Jonathan Attree 21:01:05
 Hi

I have just taken over management of a web site, many pages of which contain
the line:
<!--#include virtual="/admin/Inc­ludes/conn_Login.asp­" -->
When I try to load this page (login.asp) I get the error:

Page cannot be displayed
Active Server Pages, ASP 0126 (0x80004005)
The include file '/admin/Includes/co­nn_Login.asp' was not found.
/CECO/admin/Home/lo­gin.asp, line 10

I realise that I have to create a virtual directory but am not sure how to
do this.
Full path to file is:
C:\Inetpub\wwwroot\­CECO\admin\Home\logi­n.asp

Any help much appreciated.
Thanks
Jonathan Attree
comment 6 answers | Add comment
Wednesday, 18 June 2008
How to detect an object Dooza 20:37:20
 Hi there,I am using a stored procedure that outputs multiple recordsets.
I use <% SET rsDisplay = rsDisplay.NextRecor­dset() %> to step to the
next recordset.

In one particular condition the final recordset is not passed to the
page, so I need to detect that the object is empty.

I did just try <% If NOT rsDisplay.EOF Then %> but I get:

Microsoft VBScript runtime error '800a01a8'

Object required

Any ideas how I can trap this error? I just want the area on the ASP
page not to display when there isn't a final recordset.

Cheers,

Steve
comment 1 answer | Add comment
Validation on email address Guest 12:03:45
 Hi,
Is there a way to validate an email address and to check whether it is
sendable?


Function EmailTo(ToEmail, FromEmail, strSubject, strBody)

Set objMessage = CreateObject("CDO.M­essage")
objMessage.Subject = strSubject
objMessage.From = FromEmail
objMessage.To = ToEmail
objMessage.HTMLBody­ = strBody



objMessage.Configur­ation.Fields.Item("ttp://schemas.micros­oft.com/cdo/configur­ation/sendusing") = 2


objMessage.Configur­ation.Fields.Item("ttp://schemas.micros­oft.com/cdo/configur­ation/smtpserver") = MAILSERVER

objMessage.Configur­ation.Fields.Item("ttp://schemas.micros­oft.com/cdo/configur­ation/smtpserverport­") = 25
objMessage.Configur­ation.Fields.Update


If objMessage.Send Then
EmailTo = 1
Else
EmailTo = 0
End If

Set objMessage = nothing
End Function



The code shown as above, even if the mail is not successfully send, it still
return the value 1.


comment 6 answers | Add comment
PDA IP address Displayname 00:15:52
 Does PDA have an IP address like a PC has? Firewall access is given to a
certain IP address for PC's to access a Web application. I assume PDA also
has IP address so that it can be added to the list in order to grant it
access to the app. Is that correct?
comment 2 answer | Add comment
Tuesday, 17 June 2008
Syntax error reported near the "Select" keyword GailS 22:07:04
 Hello,

The code below results in a reported syntax error near the keyword "Select".
I copied most of this from a perfectly functioning application I worked on a
couple of years ago, that still works, just changing the references. I can't
see what it is referring to. The line number listed in the error message
references the open statement directly.

Dim rsCodes, strSelect, strEMsg, strLevel
Set rsCodes = Server.CreateObject­("ADODB.Recordset")
strSelect = "SELECT * from MemberCodes WHERE code = '" & strCode & "'"
rsCodes.open strSelect, objConn


The objConn is set up in a connex.asp included file at the beginning of the
page:

Dim objConn
Set objConn = Server.CreateObject­("ADODB.Connection")­
objConn.Open "Provider=SQLOLEDB;­ DataSource=****; " & _
"Database=*****; User ID=***; Password=*****"

Perhaps more experienced eyes can spot my syntax problem. Thanks in advance!
--
Gail S
Gent-l-kleen Products, Inc.
York, PA
comment 2 answer | Add comment
Checking for existence of a cookie GailS 18:21:00
 I tried to post this last week, but never saw it, so I hope it's not a
duplicate. (Sorry if it is.)

I am rewriting our member log-in page in classic ASP from PHP. We will be
switching platforms next month. Every member has an access number to log in.
Once they have logged in, if they accept it, a cookie is provided so they do
not have to log in again. When the code is supplied via the cookie or form,
it is validated against a database file to determine the level (customer,
distributor, etc.) and the page is built accordingly. If the code has been
inactivated or is no longer valid, appropriate messages are supplied. Pretty
basic stuff.

The first thing I want to do is to check if the cooky exists on the client
computer. PHP had code for this, but I'm not sure I'm doing it correctly in
classic ASP. My opening code is below. This is before any HTML on the page,
as I have to determine if cookeis need to be set or deleted before the page
opens. When I run this on my IIS server here, the page displays an error 500,
but no hints as to what line the error is in. Can anyone help. I suspect it
is because at this state, the cookie does not exist, as it is my first
log-in. Thanks in advance.

If Request.Cookies("kc­").HasKeys Then
bCooky = "S" 'Cookie exists, set flag for cooky set
strCode = Request.Cookies("co­de")
strSource = "cookie"
ElseIf Not IsEmpty(Request.For­m("code")) And Not
IsEmpty(Request.For­m("submit")) Then
strCode = Request.Form("code"­)
strSetCooky = Request.Form("cooky­")
strSource = "form"
End If


--
Gail S
Gent-l-kleen Products, Inc.
York, PA
comment 2 answer | Add comment

Add new topic:

How:  Register )
 
Логин:   Пароль:   
Комментировать могут: Премодерация:
Topic:
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или УК РФ.


QAIX > ASP web-programmingGo to page: « previous | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | next »

see also:
[EJB 3.0] - Re: uniqueconstraint in…
[JBoss jBPM] - ProcessInstance ID…
[JBoss jBPM] - problem while using…
пройди тесты:
see also:
baz-baz-baz-baz pam-parabaram baz-b...
internationlization and javascript
The Apache HTTP Server can be…

  Copyright © 2001—2008 QAIX
Idea: Miсhael Monashev
Помощь и задать вопросы можно в сообществе support.qaix.com.
Сообщения об ошибках оставляем в сообществе bugs.qaix.com.
Предложения и комментарии пишем в сообществе suggest.qaix.com.
Информация для родителей.
Write us at:
If you would like to report an abuse of our service, such as a spam message, please .