473,714 Members | 2,418 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Auto Submitting a form

1 New Member
Having a little problem with a project my boss gave me. We have a web based hosting site that we have multiple databases that the users can connect to. Right now we have it set up that they can choose the database they want to login to but he wants it to login to the only database the user is allowed to see.

I have a login script that I am using on another project that works great by using redirect. The problem I have with the doing the same thing on this is I need to post a form on the server so it connects to the right database and loads the software correctly.

Example of good page:

User enters username and password. If both are correct then redirect to the next page. If not, send them to a page saying that the login was incorrect.

Example of issue page:

User enters username and password. It checks to see that both are correct and populates what database they need. Once this is done I create my form with hidden fields and then...bla. I need to simulate the clicking of the submit button so the information gets processed with no user clicking.

Here is the code I need to get auto submitted:
Expand|Select|Wrap|Line Numbers
  1. <Form Action="@ITEM_PROTOCOL@://@ITEM_SERVER@/" METHOD=POST>        
  2. <INPUT type="Hidden" NAME="USER" VALUE=strUserName>
  3. <INPUT TYPE="hidden" NAME="Password" Value=rsCheckUser("pass")>
  4. <INPUT TYPE="Hidden" NAME="Database" Value=rsCheckUser("database")>
  5. <INPUT TYPE="hidden" NAME="STATION" VALUE="View">
  6. <INPUT  NAME="CONNECTION" TYPE="hidden" VALUE=@ITEM_CONNECTION@ >
  7. <INPUT  NAME="FRAME"      TYPE="hidden"  VALUE="ALL"> 
  8. <INPUT NAME="HITS" TYPE="HIDDEN" VALUE="ON">    
  9.  
  10.  
The page that this code is on is all ASP and just does the checking and the goes to the regular pages. I know I can put a confirm button on the page but I want to have nothing on this page the user can see.
Any Ideas?
Jun 29 '07 #1
2 2185
jhardman
3,406 Recognized Expert Specialist
There are two possibilities. One is a javascript approach which submits the form as soon as the document loads. I'm not an expert on javascript, but syntax is something like:
[html]onload="documen t.all.myFormNam e.submit()"[/html] notice your form needs to be named for this to work. Or it might need an ID. Like I said, I'm not an expert.

The second option is to pass a whole bunch of querystring data in the URL when you redirect.
Expand|Select|Wrap|Line Numbers
  1. page = "nextPage.asp?USER=" & strUserName
  2. page = page & "Password=" & rsCheckUser("pass")
  3. response.redirect page
If you previously only accepted form data with code like
Expand|Select|Wrap|Line Numbers
  1. request.form("USER")
this will need to be changed to
Expand|Select|Wrap|Line Numbers
  1. request.querystring("USER")
OR
Expand|Select|Wrap|Line Numbers
  1. request("USER")
notice that either of these work. Now that I think about it, you could also pass this data as cookies or as session-level variables, but querystring data takes the least amount of re-writing.

Let me know if this helps or if you would like further clarification.

Jared
Jun 29 '07 #2
danp129
323 Recognized Expert Contributor
I think something other than querystring would be best if users might be going through a proxy. The URI is almost always logged by default whereas POST isn't. Just my preference though.
Jun 30 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2579
by: James | last post by:
I have a form with a drop down list.. When the user selects the value from the list I want it to refresh automatically, as if the user has pressed submit... I have named the form 'test' and added onchange="test.submit();" to the Select field.. as so : <select size="1" name="search" onchange="frmtest.submit();">
2
2219
by: Greg T | last post by:
Hi, I have a rather long form that I don't want people submitting unless they are absolutely sure they are ready. I figured the easiest way to prevent an accidental form submission by way of hitting of the enter key was to simply not have a submit button, instead going for a regular anchor which calls a javascript confirmation box and then submits the form.
5
1908
by: Don | last post by:
I have a need to submit a form, but don't need the user to click on a button. How do I do this? Is there some way, using JavaScript, to setup a <form> tag to do this? Thanks, Don ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups ---= East/West-Coast Server Farms - Total Privacy via Encryption =---
2
2170
by: Rick Strahl [MVP] | last post by:
Run into an interesting problem today with a client of mine: They have an ASP.Net form that they want to drive through a client side HTTP interface. I know a Web Service would be a better way to go but in this case they want to try and consolidate a single interface for the 3 or 4 forms involved and drive them through a WebRequest Http client. The data is getting there no problem - it's retrievable with Request.Form. However ASP.net is...
1
2116
by: Michelle | last post by:
Hi All, I have an ASP.NET application with a session timeout of 20 minutes - for security reasons. I have a web form in this application that I need to Auto Save every 15 minutes (in case the User has left his/her desk or they got distracted and have left the program idle) - what would you recommend as the best solution for this? Thank you, Michelle
5
17710
by: Navillus | last post by:
Hey gang, I have a login form that is empty by default, but can be filled with values from a previous form: <input type=text maxlength="40" size="40" name="user" value="`usr`"> <input type=password maxlength="8" name="password" value="`pss`"> where usr and pss are sent from the previous form.
1
6727
by: Badass Scotsman | last post by:
Hello, I have an application which should never allow the back button to be pushed without refreshing the previous page. For example: Step 1: User fills in form.html and presses submit Step 2: User see's results.html and clicks back to amend form
18
13135
by: NavinM | last post by:
I have a couple of forms that are misbehaving in FireFox, but work fine in IE. when i do submit( with submit button) a javascript function validates all of the fields entered, and stops the submission if there is an error. Sample (obviously not working code): <html> <head> <script type="text/javascript"> function Submit() {
10
2164
by: laredotornado | last post by:
Hi, I'm using php 5. Does anyone have any code or a function that auto submits a form that contains a single INPUT, of type = file? Thanks, - Dave
0
8801
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8707
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9314
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9174
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9015
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7953
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6634
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5947
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4725
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.