Thursday, September 19, 2019

                            How to send mail in GO language

package main
import (
    "log"
    "net/smtp"
)
func main() {
    send("Nice to meet u my first golang gmail send successfull")
}
func send(body string) {
    var passcode string
    passcode = "123456"
    from := "pt485368@gmail.com"
    pass := "your password"
    to := "pt485368@gmail.com"
    mime := "MIME-version: 1.0;\nContent-Type: text/html; 
charset=\"UTF-8\";\n\n"
    msg := "From: " + from + "\n" +
        "To: " + to + "\n" +
        "Subject : RentMyHouse" + mime + "<html><body>
<form action ='hello.html'><input type='submit'
 value =" + passcode + " name='Confirm_Otp'><input 
type='hidden' value ='101 name='ID'></body></html>" +
        body
    err := smtp.SendMail("smtp.gmail.com:587",
        smtp.PlainAuth("", from, pass, "smtp.gmail.com"),
        from, []string{to}, []byte(msg))

    if err != nil {
        log.Printf("smtp error: %s", err)
        return
    }
    log.Print("sent, message sent successfully")
}

OTP Generate in golang

                 How to Generate  OTP in Go Language    

 
 first of open visual studio code text editor then write code below mention ..
 then run command       go run <filename>.go
 Enter command OTP is print .
 Thank you..

package main
import (
    "fmt" 
)
func main() {
    func main() {
         fmt.Println(gotp.NewDefaultTOTP("4S62BZNFXXSZLCRO").Now())
    }
}

Friday, February 8, 2019

                                

                        **** Create Responsive Table Using HTML and CSS ****


                                                                 ---- HTML USE ----

<!DOCTYPE html>
<head>
    <meta  charset="UTF-8"></meta>
    <meta  name="viewport"  content="width-device-width,initial-scal=1.0">
 </head>
<title>Responsive CSS</title>
<link rel="stylesheet" href="mystyle.css"></link>
<body>
<h2>Responsive table</h2>
    <div class="col">
        <ul class="price-box">
            <li class="header">Simple</li>
            <li class="emph"><strong>$6.50</strong>/Month</li>
            <li><strong>20Gb</strong> Disk space</li>
            <li><strong>10Gb</strong> Data Transfer</li>
            <li><strong>2</strong> Domains </li>
            <li><strong>50</strong> Email Accounts</li>
            <li><strong>2</strong> FTP</li>
            <li class="emph"><a href="#" class="button">Sign Up</a></li>
         </ul>   
    </div>

    
        
    <div class="col">
        <ul class="price-box">
            <li class="header header-green">Standard</li>
            <li class="emph"><strong>$16.50</strong>/Month</li>
            <li><strong>10Gb</strong> Disk space</li>
            <li><strong>15Gb</strong> Data Transfer</li>
            <li><strong>10</strong> Domains </li>
            <li><strong>100</strong> Email Accounts</li>
            <li><strong>2</strong> FTP</li>
            <li class="emph"><a href="#" class="button">Sign Up</a></li>
         </ul>   
    </div>
    
    
    
    <div class="col">
        <ul class="price-box">
            <li class="header">Simple</li>
            <li class="emph"><strong>$26.50</strong>/Month</li>
            <li><strong>120Gb</strong> Disk space</li>
            <li><strong>90Gb</strong> Data Transfer</li>
            <li><strong>unlimited</strong> Domains </li>
            <li><strong>unlimited</strong> Email Accounts</li>
            <li><strong>unlimited</strong> FTP</li>
            <li class="emph"><a href="#" class="button">Sign Up</a></li>
         </ul>   
    </div>
</body>
</html>


                                                               -----  CSS USE   ----


body
{
    font-family:"Tahoma",sans-serif;
    background:#333;
    color:#fff;
}
h2{
    text-align:center;
}
.col
{
    float:left;
    width:33.3%;
    padding:8px;
    box-sizing:border-box;
}

.price-box
{
    background:#fff;
    color:#555;
    list-style-type:none;
    border:1px solid #555;
    margin:0;
    padding:0;
    
}

.price-box:hover,.price-box.best
{
    box-shadow:0 10px 15px 0 #000;
}

.header
{
    background-color:#111;
    color:#fff;
    font-size:25px;
}
.price-box li
{
    padding:20px;
    border-bottom:1px solid #eee;
    text-align:center;
}
.price-box .emph
{
    background-color:#f4f4f4;
    font-size:20px;
}
.price-box .header.header-green
{
    background-color:#4caf50;
}
.button
{
    background-color:#4caf50;
    border:none;
    color:#fff;
    padding:10px 15px;
    text-align:center;
    text-decoration:none;
    font-size:18px;
}
@media(max-width:700px)
{
    .col{
        width:100%;
    }

}




Create AboutMe Profile Using HTML..






See look this code and try.. to make profile..



<html>
<head>
<title>This is My Profile</title>
</head>
<body>
<center>
 <div Style="background-image:linear-gradient(red,yellow); width:700px;  border:solid 1px red; margin:100px;" >
 <br>
 <table>
 <tr>
      <td style="width:250px;">
          <div Style="padding-left: 10px;">
               <img Style="width:200px; height:200px; border-radius: 50%; padding-left: 10px;" src="IMG-20180119-WA0013.jpg" />
               <center><h1>Pradeep Tomar</h1>
               <h4>IT Student</h4></center>
          </div>
      </td>
      <td>
          <div Style="padding-left: 20px;">
               <p>
               <b>Hi</b>, my name is Pradeep Tomar from Agra. I parsuing my Diploma in stream of Information Technology  from DEI college. 
               My strengths are hardworker, self motivating and dedicated towards my work. And also I'm a good learner as well as teacher.
               My hobbies are Sports like Racing, Cricket and designing ,Developing .My short term goal to get placed in well Software company.
               My long term goal to palced in any mnc Software company and give my best to your.
              Organisation. As a fresher, I  have Software/web developing In project working experience, but I will prove once the opportunity comes.
              </p>
     <ul>
        <li><a href="https://pt48536.blogspot.com/">My blog</a></li>
      </ul>
          </div>
   <tr>
  </table>
  </center>
</body>
</html>






Sunday, November 4, 2018


Q: Design one form to create application like Richtext document using 1 RichTextbox  and different buttons. When user presses any of this command buttons then the selected content of Rich textbox will be changed accordingly.



  Ans:  Visit Coding    Click Here



Friday, August 3, 2018


    JSP(Java Server Page): how to Change Password from database in using mysql
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>update</title>
</head>
<body>
<%!
        Connection con;PreparedStatement st;
        String a,b;
%>
<%
a=request.getParameter("Password");
b=request.getParameter("oldPassword");
%>
<%
       
        try
        {
               Class.forName("com.mysql.jdbc.Driver");
               con=DriverManager.getConnection("jdbc:mysql://
                   localhost:3306/sts","root","root");
               String str="Update sts.users set Password=? Where
                            password=?";      
               st=con.prepareStatement(str);
               st.setString(1,a);
               st.setString(2,b);
               st.executeUpdate();
               out.print("recordUpdated");
        }
        catch(Exception e)
        {
               out.print(e.toString());
        }
%>
</body>
</html>



         JSP(Java Server Page): how to Delete Record data from database in using mysql

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Patient Delete...</title>
</head>
<body>
<%!
        Connection con; PreparedStatement st;
        String Id;
%>
<%
        Id=request.getParameter("PatientId");
        try
        {
               Class.forName("com.mysql.jdbc.Driver");
               con=DriverManager.getConnection("jdbc:mysql://
                   localhost:3306/hospital","root","root");
               String str="delete from Patient where PatientId=(?)";
               st=con.prepareStatement(str);
               st.setString(1, Id);
               int g=st.executeUpdate();
               out.print("Record Deleted....");
               con.close();
        }
        catch(Exception e)
        {
               out.print(e.toString());
        }
%>
</body>
</html>



        JSP(Java Server Page): how to insert data from database in using mysql
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Patient Details....</title>
</head>
<body>
<%!
        Connection con;PreparedStatement st;
        String Id,name,bednum,wardnum,doctorname,department;
%>
<%
        Id=request.getParameter("PatientId");
        name=request.getParameter("PatientName");
        bednum=request.getParameter("BedNum");
        wardnum=request.getParameter("WardNum");
        doctorname=request.getParameter("DoctorName");
        department=request.getParameter("Department");
        try
        {
               Class.forName("com.mysql.jdbc.Driver");
               con=DriverManager.getConnection("jdbc:mysql://                             localhost:3306/hospital","root","root");
               String str="insert into patient values(?,?,?,?,?,?)";
               st=con.prepareStatement(str);
               st.setString(1, Id);
               st.setString(2, name);
               st.setString(3, bednum);
               st.setString(4, wardnum);
               st.setString(5, doctorname);
               st.setString(6, department);
               int g=st.executeUpdate();
               out.print("Record Saved...");
        }
        catch(Exception e)
        {
               out.print(e.toString());
        }
%>

</body>
</html>

    
    JSP(Java Server Page): how to retrieve data from database in using mysql
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Patient Show...</title>
</head>
<body>
<%!
        Connection con; Statement st; ResultSet rs;
%>
<%
        try
        {
               Class.forName("com.mysql.jdbc.Driver");
               con=DriverManager.getConnection("jdbc:mysql://localhost:
                   3306/hospital","root","root");
               st=con.createStatement();
               rs=st.executeQuery("select * from Patient");
        %>
        <form>
        <center>      
        <h1>All Details Are Here....</h1>
        <table border="1" width="80%">
        <tr>
        <td><center>Patient Id</center></td>
        <td><center>Patient Name</center></td>
        <td><center>Bed Number</center></td>
        <td><center>Ward Number</center></td>
        <td><center>Doctor Name</center></td>
        <td><center>Department</center></td>
        </tr>
    <%
    while(rs.next())
    {%>
        <tr>
        <td><center><%=rs.getString(1)%></center></td>
        <td><center><%=rs.getString(2)%></center></td>
        <td><center><%=rs.getString(3)%></center></td>
        <td><center><%=rs.getString(4)%></center></td>
        <td><center><%=rs.getString(5)%></center></td>
        <td><center><%=rs.getString(6)%></center></td>
        </tr>
    <%}
        }
catch(Exception e)
{
out.print(e.toString());
}
%>
</table>
</center>
</form>
</body>
</html>