Jump to content

Submitting Forms


scott100

Recommended Posts

Do you need to have 2 seperate pages to submit/process a form with ASP, one for collecting user info and then the other for processing it.For example i can do this with one php page like so.

<?php ini_set ('display_errors', 1);error_reporting (E_ALL & ~E_NOTICE);if ( isset ($_POST['submit'])) // Check if the form has been submitted.{          $user=$_POST['username'];          print"<p>Thank you for pressing submit: $user</p>";} else // page not submitted, display form{	print '<form action="test.php" method="post">       <p>Username: <input type="text" name="username" size="20" /><br />	       <input type="submit" name="submit" value="Log In!" /></p>       </form>';}?>

isset ($_POST['submit'])I can use this function to check if the form has been submitted, if form not submitted display form, if form submitted process form.This is all done within one page, can asp do this?thanks.

Link to comment
Share on other sites

This is the same sort of idea I use for my login script...ill make it blank and if you want more help just ask and I can fill it in

'First find if there is any form informationIf Request.Form<>"" Then'If there is information thenResponse.write("Usernmae is:" & Request.Form("user"))Else'If no form informationRespnse.write("No Username inputted")End If

Now if you want to make a login script you need to make a recordset and do alot of processing of the form data. If you want me to continue with the script just add me to your MSN (alex.xenondesign[at]gmail.com)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...