Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old February 24th, 2006, 01:35 PM
raj chahal
Guest
 
Posts: n/a
Default multipart form processing

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.


  #2  
Old February 24th, 2006, 06:45 PM
Paxton
Guest
 
Posts: n/a
Default Re: multipart form processing


raj chahal wrote:[color=blue]
> 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.[/color]

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.

  #3  
Old February 27th, 2006, 02:45 PM
raj chahal
Guest
 
Posts: n/a
Default Re: multipart form processing

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" <info@digitise.info> wrote in message
news:%23RjVIXUOGHA.2472@TK2MSFTNGP11.phx.gbl...[color=blue]
> 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[/color]
adds[color=blue]
> 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[/color]
be[color=blue]
> set to mulipart/form-data.
>
> Now when I add a new user via the registration form, the processing page[/color]
for[color=blue]
> some reason assumes the user is already registered (BUT IS NOT IN[/color]
DATABASE)[color=blue]
> and the server.transfer code is executed ? sending the user back to the
> registration page.
>
> Whats going on here ? and remedies ?
>
> Thanks again.
>
>[/color]


  #4  
Old February 27th, 2006, 05:05 PM
Paxton
Guest
 
Posts: n/a
Default Re: multipart form processing


raj chahal wrote:[color=blue]
> 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"[/color]


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.

[color=blue]
>
> 'we would now do a query to see if that registration details are unique, but
> we will cover that in a later tutorial
>[/color]

!!!!??!! *cough*

/P.

 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles