|
Ok, I have done alot of research on the xml Http object with the use of Javascript. Before I didn't know anything about it. But feel that I have gain a substantial understanding of it all. Anyhow,I am still a little bit confuse with the HttpAPI.asp. How does it relate to my asp.net membership? Is the example given (e.g."HttpAPI.asp?action=GetUsers&Username=Adminsitrator&Password=letmein" ) looking for the information in a database? Which database? How will I gaurante that my user that created an account will have unmitigated access to the forums if I am not allowed to check to see if they are already in my database via my .aspx page with my code? The example below shows an absolute url to a asp page that checks to see if the username already exist. How will the HTTPAPI check to see if the user exist if it is not checking the original database with which the user already exist. If I sound confuse, I am. Enlighten me with your knowledge if you can.
Here are my hopes that this Web wiz forum can accomplish or else I wasted $129.00 plus tax and will be moving on to another forum software.
1. The user should be able to access the forums without having to create a new account. 2. I would like to display the username and profile image in the forums. 3. I also woud like to display thing such as, age, location and date join the site.
Is any of this posible with this forum? Thank you.
<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
function validateuserid(suserid) {
document.body.style.cursor='wait';
// Create an instance of the XML HTTP Request object
var oXMLHTTP = new ActiveXObject( "Microsoft.XMLHTTP" );
// Prepare the XMLHTTP object for a HTTP POST to our validation ASP page
var sURL = "http://mysite/mypath/validateuser.asp?username=" + suserid
oXMLHTTP.open( "POST", sURL, false );
// Execute the request
oXMLHTTP.send();
if (oXMLHTTP.responseText == "exists")
alert("Sorry - the User ID " + suserid + " already exists.");
document.body.style.cursor='auto';
}
</SCRIPT>--------------------------- <%
Dim objConn, objRS, sUserID
'Capture the username that we need to lookup, making sure its prepared for
'our forthcoming SQL query
sUserID = Replace(Trim(Request.QueryString("userid")),"'","")
'Fire up ADO - ask the database whether or not the user idexists
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open CONNECTIONSTRING
sSQL = "select userid from usertable where userid = '" + sUserID + "'"
Set objRS = objConn.Execute(sSQL)
If Not objRS.EOF Then Response.Write "exists"
'Clean up
objRS.Close
objConn.Close
Set objRS = Nothing
Set objConn = Nothing
%>
|