Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 24th, 2007, 01:56 AM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Sorry buddy it's 4.50 on a Friday, home time for me...

Run this in your browser I have placed some client side validation so your user can not proceed umless they have entered a value. Try to submit your form without entering a value to see what i mean

I would post this page to ITS SELF then:

1..based on user input ask the DB is there a record:
   a..IF SO assign the ID to a session variable and redirect the user to where ever
   b..IF NOT promt them 'sorry no details found, try again

so at the top od your page
<%
   if request.form("cid") <> "" then
       'connect to DB
       'run query see if there is a match
       'NOW ASSIGN SESSION VARIABLE
       'direct them to where you want to go
   else
       'this is the default page load
   end if
%>

Anyhow go to run, good luck




Wind is your friend
Matt
 
Old August 24th, 2007, 02:18 AM
Authorized User
 
Join Date: Aug 2007
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanx MAT...I'll try this...lets see :)
 
Old August 24th, 2007, 02:46 AM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

I forgot to post the page, now Im gong home - here it is:

<html>
 <head>
 <script>
  function validate()
  {
     if (document.formName.cid.value == "")
     {
        alert("You mut enter a name to proceed.");
        document.formName.cid.focus();
        return (false);
     }
  }
 </script>
  <title></title>
 </head>
<body>

<form name="formName" action="delete.asp" method="post" onsubmit="return validate();">
    <div align="center">
      <center>
    <table border="2" cellpadding="0" cellspacing="0"
 style="border-collapse: collapse; text-align:center" width="40%"
 bgcolor="#E1E1E1"
 height="104">
      <tr>
        <td width="100%" colspan="2" bgcolor="#3163A0" height="22">
        <p align="center">


        Member Login</td>
      </tr>
      <tr>
        <td width="47%" style="text-align: left" height="20">

        &nbsp;Company-ID:</td>
        <td width="53%" style="text-align: left" height="20">
              &nbsp;<input type="text" name="cid" size="11" style="border-style: solid; border-width:1"></td>
      </tr>

      <tr>
        <td width="100%" colspan="2" height="26">
        <p align="center">
                <input type="submit" value="Sign-In" name="signin"></td>
      </tr>
      <tr>
        <td width="100%" colspan="2" height="12">
        <p align="right">
        &nbsp;</td>
      </tr>
    </table>
    <table border="0" cellpadding="0" cellspacing="0"
 style="border-collapse: collapse" bordercolor="#111111" width="100%"
 id="AutoNumber5">
      <tr>
        <td width="100%">&nbsp;</td>
      </tr>
      <tr>
        <td width="100%">&nbsp;</td>
      </tr>


      <tr>
        <td width="100%">&nbsp;</td>
      </tr>
      <tr>
        <td width="100%">&nbsp;</td>
      </tr>
      <tr>
        <td width="100%">&nbsp;</td>
      </tr>
      <tr>
        <td width="100%">&nbsp;</td>
      </tr>
    </table>
      </center>
    </div>
    </form>
  </center>
</div>
</body>

</html>

Wind is your friend
Matt
 
Old August 24th, 2007, 03:00 AM
Authorized User
 
Join Date: Aug 2007
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanx MAT!






Similar Threads
Thread Thread Starter Forum Replies Last Post
Connections in a Sql Server project mlw C# 2 September 15th, 2008 09:32 AM
Error in Migrating Project from ASP to ASP.NET hbansal ASP.NET 1.0 and 1.1 Professional 0 September 12th, 2008 05:48 AM
Add asp.net page to asp project debdemoe Classic ASP Basics 0 August 17th, 2005 12:28 PM
ms Project,vb,sql m_ctrl VB How-To 0 June 28th, 2003 10:36 AM
ms project,sql,vb m_ctrl Pro VB 6 0 June 28th, 2003 10:28 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.