By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,836 Members | 1,983 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,836 IT Pros & Developers. It's quick & easy.

multipart form processing

P: n/a
Hi there

i have created a registration page containing a form than sends username
password to an asp processing page. If the user exists it sends the user
back to the registration page with server.transfer command otherwise it adds
the new user to the database as expected.

Anyhow I now want to add an upload feature to the registration page (using
pure-asp). The example I used says that the form Enctype property should be
set to mulipart/form-data.

Now when I add a new user via the registration form, the processing page for
some reason assumes the user is already registered (BUT IS NOT IN DATABASE)
and the server.transfer code is executed ? sending the user back to the
registration page.

Whats going on here ? and remedies ?

Thanks again.
Feb 24 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a

raj chahal wrote:
Hi there

i have created a registration page containing a form than sends username
password to an asp processing page. If the user exists it sends the user
back to the registration page with server.transfer command otherwise it adds
the new user to the database as expected.

Anyhow I now want to add an upload feature to the registration page (using
pure-asp). The example I used says that the form Enctype property should be
set to mulipart/form-data.

Now when I add a new user via the registration form, the processing page for
some reason assumes the user is already registered (BUT IS NOT IN DATABASE)
and the server.transfer code is executed ? sending the user back to the
registration page.

Whats going on here ? and remedies ?

Thanks again.


At a guess, it would seem that the revisions you have made to your page
code have resulted in faulty logic. But no one here will be able to
offer concrete help without seeing your code. Post the relevant parts
of it so we don't have to guess.

/P.

Feb 24 '06 #2

P: n/a
Hi there
I've posted the code hope someone can help.

Here is the code for the form :

<%@LANGUAGE="VBSCRIPT"%>
<html>
<head>
<title>Register</title>
</head>
<body>

<form action="registered.asp" method="post" enctype="multipart/form-data"
name="register">
<table border="0">
<tr>
<td width="103">Username :</td>
<td width="652"><input name="username" type="text" id="username">
</td>
</tr>
<tr>
<td>First Name : </td>
<td width="652"><input name="firstname" type="text" id="firstname"
value="<%=Request.Form("firstname")%>"></td>
</tr>
<tr>
<td>Surname :</td>
<td><input name="surname" type="text"
value="<%=Request.Form("surname")%>"></td>
</tr>
<tr>
<td>Password :</td>
<td><input type="password" name="password"></td>
</tr>
<tr>
<td>Email :</td>
<td><input name="email" type="text"
value="<%=Request.Form("email")%>"></td>
</tr>
<tr>
<td><p>&nbsp;</p> </td>
<td><br>
</td>
</tr>
<tr>
<td colspan="2"><input name="submit" type="submit"
value="submit"></td>
</tr>
</table>
</form>

</body>
</html>

And here is the code for the processing :

<html>
<head>
<title>Registered Routine</title>
</head>
<body>

<%

'bring forward the 4 variables:username, surname, password,email

username=request.form("username")
surname=request.form("surname")
password=request.form("password")
email=request.form("email")

'we would now do a query to see if that registration details are unique, but
we will cover that in a later tutorial

'now to open up the database
%>
<!--#include file="connection.asp"-->
<% ' new raj

'do a loop and check each record for the users, when found set Check to 1
(success)

myquery = "SELECT username,password FROM users"

set query=Conn.execute(myquery)
do while not query.eof

username2=query("username")
password2=query("password")
'if username and password is found in the database together then make check
=1 ie a success

if (username=username2) AND (password=password2) then
'check to see if the user has activated. 0 = not activated,1 = activated

response.write "user exists<br />"

' Response.Redirect("register.asp")
Server.transfer ("register.asp")

end if
set conn = nothing
query.movenext
loop

set query = nothing

' end raj
%>

"raj chahal" <in**@digitise.info> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi there

i have created a registration page containing a form than sends username
password to an asp processing page. If the user exists it sends the user
back to the registration page with server.transfer command otherwise it adds the new user to the database as expected.

Anyhow I now want to add an upload feature to the registration page (using
pure-asp). The example I used says that the form Enctype property should be set to mulipart/form-data.

Now when I add a new user via the registration form, the processing page for some reason assumes the user is already registered (BUT IS NOT IN DATABASE) and the server.transfer code is executed ? sending the user back to the
registration page.

Whats going on here ? and remedies ?

Thanks again.

Feb 27 '06 #3

P: n/a

raj chahal wrote:
Hi there
I've posted the code hope someone can help.

Here is the code for the form :

<%@LANGUAGE="VBSCRIPT"%>
<html>
<head>
<title>Register</title>
</head>
<body>

<form action="registered.asp" method="post" enctype="multipart/form-data"

You could get rid of enctype="multipart/form-data". It's preventing
the request.form values from being passed to the processing page.
Alternatively, if you are going to add the facility for people to
upload files as part of this script, check the documentation for your
upload component to see how to access them.


'we would now do a query to see if that registration details are unique, but
we will cover that in a later tutorial


!!!!??!! *cough*

/P.

Feb 27 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.