Wednesday, December 24, 2014

SIMPLE DATABASE CONNECTIVITY PROGRAM IN PHP

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>PHP DATABSAE</title>
</head>

<body>
<?php

$query=mysql_connect("localhost","root","");
mysql_select_db("cloud",$query) ;
$name1=$_POST['firstname'];
$name2=$_POST['lastname'];
//echo "insert into register(firstname,secondname)values('$name','$name2')";
$query1=mysql_query("INSERT into register(firstname,secondname)values('$name1','$name2')");
if($query1)
{
 echo "succesfully submitted";
 }
 else
 {
 echo "please submit again";
 }

?>
</body>
</html>

Wednesday, December 17, 2014

TIMER APPLICATION code for 20 Minutes Alert using c#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Timer
{
    public partial class Form1 : Form
    {

        int i = Convert.ToInt32(0);
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

            label1.Text = DateTime.Now.ToString();
           

        }

        private void timer1_Tick(object sender, EventArgs e)
        {

            i++;
            if (i==20)
            {
                MessageBox.Show("20 minutes is left");
                i = 0;
            }

        }