Click here to Skip to main content
15,922,894 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to submit my html form data to Sql server database or I could send this data to on My Email Id as well........
pls tell me i need to do this work......
HTML
<html>
<head>
<style type="text/css">

.design{

    border:1.5px solid #3267cd;
    padding:9px;
    -webkit-border-radius:20px;
    -moz-border-radius:20px;
    border-radius: 12px;
    font-size:15px;
    font-weight:bold;
    color: #333;
    }

.button_example{
border:1px solid #495267;-webkit-box-shadow: #4C9DB5 0px 2px 2px  ;-moz-box-shadow: #4C9DB5 0px 2px 2px ; box-shadow: #4C9DB5 0px 2px 2px  ; -webkit-border-radius: 12px; -moz-border-radius: 12px;border-radius: 12px;width:120px;font-size:18px;font-family:arial, helvetica, sans-serif; padding: 5px 5px 5px 5px; text-shadow: 3px 3px 0 rgba(19,20,20,0.3);font-weight:bold; text-align: center; color: #DEF2FF; background-color: 3267cd;
 background-image: -webkit-gradient(linear, left top, left bottom, from(#abd4f2), to(#3267cd));
 background-image: -webkit-linear-gradient(top, #abd4f2, #3267cd);
 background-image: -moz-linear-gradient(top, #abd4f2, #3267cd);
 background-image: -ms-linear-gradient(top, #abd4f2, #3267cd);
 background-image: -o-linear-gradient(top, #abd4f2, #3267cd);
 background-image: linear-gradient(to bottom, #abd4f2, #3267cd); filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#abd4f2, endColorstr=#3267cd);
}

.button_example:hover{
 border:1px solid #363d4c; background-color: #4B546A;
 background-image: -webkit-gradient(linear, left top, left bottom, from(#4B546A), top(#2c354b));
 background-image: -webkit-linear-gradient(top, #4B546A, #2c354b);
 background-image: -moz-linear-gradient(top, #4B546A, #2c354b);
 background-image: -ms-linear-gradient(top, #4B546A, #2c354b);
 background-image: -o-linear-gradient(top, #4B546A, #2c354b);
 background-image: linear-gradient(to bottom, #4B546A, #2c354b);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#4B546A, endColorstr=#2c354b);
}



.button_example1{
border:2px solid #495267;-webkit-box-shadow: #4C9DB5 0px 2px 2px  ;-moz-box-shadow: #4C9DB5 0px 2px 2px ; box-shadow: #4C9DB5 0px 2px 2px  ; -webkit-border-radius: 12px; -moz-border-radius: 12px;border-radius: 5px;width:277px;font-size:29px;font-family:arial, helvetica, sans-serif; padding: 5px 5px 5px 5px; text-shadow: 3px 3px 0 rgba(19,20,20,0.3);font-weight:bold; text-align: center; color: #DEF2FF; background-color:3267cd;
 background-image: -webkit-gradient(linear, left top, left bottom, from(#abd4f2), to(#3267cd));
 background-image: -webkit-linear-gradient(top, #abd4f2, #3267cd);
 background-image: -moz-linear-gradient(top, #abd4f2, #3267cd);
 background-image: -ms-linear-gradient(top, #abd4f2, #3267cd);
 background-image: -o-linear-gradient(top, #abd4f2, #3267cd);
 background-image: linear-gradient(to bottom, #abd4f2, #3267cd); filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#abd4f2, endColorstr=#3267cd);
}
<!--
.button_example2:hover{
 border:1px solid #363d4c; background-color: #4B546A;
 background-image: -webkit-gradient(linear, left top, left bottom, from(#4B546A), top(#2c354b));
 background-image: -webkit-linear-gradient(top, #4B546A, #2c354b);
 background-image: -moz-linear-gradient(top, #4B546A, #2c354b);
 background-image: -ms-linear-gradient(top, #4B546A, #2c354b);
 background-image: -o-linear-gradient(top, #4B546A, #2c354b);
 background-image: linear-gradient(to bottom, #4B546A, #2c354b);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#4B546A, endColorstr=#2c354b);
}-->
</style>

<title>    Enquiry Form </title>
</head>

<body >
<div align="center">

<table align="center" border="2px" width="22%" bgcolor="BFBABC" style="border-radius:10px 10px 10px">
<tr height="60px" ><th><font size="20%" color="silver"><input type="button" class="button_example1" value="Enquiry" /></font></th></tr>
<tr align="center" style = "padding : 0px" > <td>
<form ></br>
<input class="design" type="text" placeholder="Name" size="30%" maxlength="30" style="padding-top:8px; background-color:white"></br></br>
<input class="design" type="text" placeholder="Course" size="30%" maxlength="30" style="padding-top:8px; background-color:white"></br></br>
<input class="design" type="text" placeholder="Email" size="30%" maxlength="254" style="padding-top:8px; background-color:white"></br></br>
<input class="design" type="text" placeholder="Mobile" size="30%" maxlength="10" style="padding-top:8px; background-color:white"></br></br>
<textarea class="design" name="query_message" cols="26" rows="2" placeholder="Message" maxlength ="300" style="background-color:white"></textarea></br></br>
<!--<input type="submit" value="Submit" style="height: 35px; width: 140px;background-color:gold;">-->
<input  type="button" class="button_example" value="Submit" />
</form></td>
</tr>

</table>
</div>
</body>

</html>
Posted
Updated 23-Mar-13 8:48am
v2
Comments
Prasad Khandekar 23-Mar-13 7:51am    
Naveen, You will have to have a program running in web server to which your code will POST this data and then server side program will add the data to database You can use ASP.NET, PHP, JSP and many more languages to write this handler on the server side. Hope this helps.
Naveen Kumar Kaushik 24-Mar-13 0:22am    
thankx Prasad Khandekar. My problem is that i m having a html website i need to submit the data in sql server without using any serverside technology.if i use the server side technology like Asp .net how can i do this code without showing the user i m using server side technology...

1 solution

Read about ADO.NET here and it will help you.

Look at these:
MSDN: ADO.NET[^]
Simple ADO.NET Database Read, Insert, Update and Delete using C#.[^]
 
Share this answer
 
Comments
Naveen Kumar Kaushik 24-Mar-13 0:32am    
Thankx Sandeep Mewara for suggestion for my problem but i need something which i used in client side for data storage apart from ado .net.if i use ado in this i have to use asp .net
i don't want to show the user i m using server side technolgoy............
Sandeep Mewara 24-Mar-13 0:49am    
No. Using ADO.NET does not mean you use ASP.NET.

Further, if you want to store data in SQLserver you need a way to connect and pass on value to DB, i.e. ADo.NET.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900