codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Registration page  screename at 17:02 on Tuesday, May 09, 2006
 

Hi, I'm curently doing a project that requires registration page. What I am facing down is that even after adding contraints in my database(mySQL), I can still submit my registration form with all fields blank and it gets recorded into the database table. Kindly someone please assist? Thank you!

<%@ page import="java.sql.*" %>

<%
String connectionURL = "jdbc:mysql://localhost:3306/project?username=;password=";
Connection connection = null;
Statement statement = null;
ResultSet rs = null;
%>

<HTML>

<HEAD>
<TITLE> xxxxxx </TITLE>
</HEAD>

<body>

<font color="#0000a0" size="4" weight="heavy">

<%

Class.forName("com.mysql.jdbc.Driver").newInstance();
connection = DriverManager.getConnection(connectionURL, "", "");
statement = connection.createStatement();

String name = request.getParameter("name");
String passwd = request.getParameter("password");
String add = request.getParameter("address");
String contact = request.getParameter("contactNo");
String sques = request.getParameter("sQues");
String sans = request.getParameter("sAns");
String nric = request.getParameter("nric");

try{
statement.executeUpdate("INSERT INTO login VALUES ('"+name+"','"+passwd+"','"+add+"','"+contact+"', '"+sques+"' , '"+sans+"', '"+nric+"')" );
%>
<font size="3">Your registration has been completed!</font>
<FORM ACTION="/forum/loginPage.html" METHOD="GET">
<INPUT TYPE=Submit VALUE="Login">
</FORM>
<%
}
catch (SQLException sqle)
{%>
<font size="3">Sorry, Register unsuccessful. Please fill up the required columns.</font>
<%
}


%>

<body bgcolor="#FFFFFF">

<style>
a:link {color: #ff80a0; text-decoration: none; font-weight: none;}
a:active {color: #ff8080; text-decoration: none; font-weight: none;}
a:visited {color: #ff4040; text-decoration: none; font-weight: none;}
A:hover {color: #4020a0; text-decoration: none; font-wright: none;}
</style>


</TABLE>
<h3><font face="Times New Roman">
<a href = "/forum/registerPage.html">Back To Register Page</a></font></h3>

</BODY>
</HTML>






  Re: Registration page  miteshbhimjiyaani at 13:52 on Tuesday, May 16, 2006
 

hi
where is your main page .
may be u are missing paramter.
i mean , u may be gave like this in main page for input name

<input type=text id=name>

so just change that and give like that

<input type=text id=name name=name>

Thanks

  Re: Registration page  screename at 15:39 on Tuesday, May 16, 2006
 

:) Ok, I'll try. Thanks so much!








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Select index`s and HTML Forms
•  Re: How to change the location?
•  Re: How can I read ASCII data file in C++
•  Display new link everyday for whole year in a sequence
•  sending soap requests
•  New to Data Access Classes
•  format date/time to return to database - second attempt
•  format date/time to return to database
•  Trying to create a C++ Object Oriented game


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2006