473,513 Members | 2,605 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.
Feb 24 '06 #1
3 2084

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
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

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
29059
by: Steven K | last post by:
Hello, I am using an asp page (upload.asp) to gather information and to upload files to the web server using SoftArtisans SAUpload Tool. In the first page (upload.asp), I have a form for...
2
4528
by: Lovely Angel For You | last post by:
Dear Friends Hope you all are doing great. I am using a form to add text data to the database. With this form I am also using a file field to upload a image file. To use the first thing that...
10
19308
by: Gregory A Greenman | last post by:
I'm trying to write a program in vb.net to automate filling out a series of forms on a website. There are three forms I need to fill out in sequence. The first one is urlencoded. My program is...
4
4563
by: Alex Sibilev | last post by:
Hello, I have a really weird problem I've been trying to solve it without any luck for the last couple of hours :( I'm writing a "conference board" application (quite similar to ASP.NET...
7
17259
by: Mark Waser | last post by:
Hi all, I'm trying to post multipart/form-data to a web page but seem to have run into a wall. I'm familiar with RFC 1867 and have done this before (with AOLServer and Tcl) but just can't seem...
2
10070
by: ed kool | last post by:
Question how to code "multipart/form-data” in a PHP script ? We are trying to make our program trchat.exe work via the following PHP script: <?php $lang = " English to Dutch"; ...
4
3131
by: pbd22 | last post by:
hi. could somebody tell me, when uploading a file, i know the form where the upload component is must have enctype=multipart/form-data but, is the same true for the form with the server code to...
4
32491
by: vunet.us | last post by:
Hi all, I am converting my app to AJAX-based. I have a form that submits some data including images. When I use AJAX XmlHttpRequest I am unable to submit the form with...
6
10540
by: fnoppie | last post by:
Hi, I am near to desperation as I have a million things to get a solution for my problem. I have to post a multipart message to a url that consists of a xml file and an binary file (pdf)....
0
7160
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7537
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7525
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5685
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5086
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4746
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3233
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3222
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
799
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.