Saturday, 30 June 2012

Simple Javascript


<html>
<head>
   <title>kamal Javascript Code</title>
</head>
<body>
<script type="text/javascript" language="JavaScript">
   document.writeln( "Hi Guys U r Using Kamal Code" );
var j = 10;
for (i=0; i<10; i++)
{
      j=j+1;
}
   document.writeln( "value of j="+j );
</script>
</body>
</html>

Friday, 29 June 2012

Css Style's


<style type="text/css">
a:link {color:#FF0000;}    /* unvisited link */
a:visited {color:#00FF00;} /* visited link */
a:hover {color:#FF00FF;}   /* mouse over link */
a:active {color:#0000FF;}  /* selected link */
</style>

Sum Of Digit's In PL/SQL


set serveroutput on
declare
N number(5);
s number(5):=0;
r number(5);
d number(5);
begin
n:=&N; 
while N<>0 loop
d:=mod(N,10);
s:=s+r+d;
end loop;
dbms_output.put_line('sum of digits is-'||s);
end;
/

Find Out greatest Of Three Number's In PL/SQL

declare
a number(10);
b number(10);
c number(10);
begin
a:=&a;
b:=&b;
c:=&c;
if(a>b)and(a>c) then
dbms_output.put_line('a is greater');
elsif(b>c) then
dbms_output.put_line('b is greater');
else
dbms_output.put_line('c is greater');
end if;
end;
/

Find Out Area nd Circumference In PL/SQL

set serveroutput on
declare
rad number(5):=&r1;
ar number(5,2);
circle number(5,2);
pie constant number(5,2):=3.14;
begin
ar:=pie*rad*rad;
circle:=2*pie*rad;
dbms_output.put_line('area of circle is'|| ar);
dbms_output.put_line('circumference is'||circle);
end;
/

Insertion In Array At Different Position's Using C++


#include<iostream.h>
#include<conio.h>
#include<process.h>
#include<dos.h>
 int a[15],i,n,item,k,j;
 void main()
 {


   void menu();
   void top(int [],int &);
   void last(int [],int &);
   void kth(int [],int &);
   void display(int [],int &);
   clrscr();
     int a[15],i,n,item;
  clrscr();
   cout<<endl<<"enter the no of elements :";
   cin>>n;
   cout<<endl<<" enter the elements : ";
     for(i=0;i<n;i++)
     {
cout<<endl<<"a["<<i<<"] = ";
cin>>a[i];
     }
     while(1)
    {
       menu();
       int o;
       cout<<endl<<endl<<"ENTER YOUR CHOICE :";
       cin>>o;
       switch(o)
       {
case 1:
top(a,n);
break;
case 2:
last(a,n);
break;
case 3:
kth(a,n);
break;
case 4:
display(a,n);
break;
case 5:
cout<<endl<<endl<<"EXITING. . . .";
delay(1000);
exit(0);
default:
cout<<endl<<endl<<"WRONG CHOICE. . .TRY AGAIN. . ";
getch();
       }
    }
 }


  void menu()
  {
    clrscr();
    cout<<endl<<endl<<"\t\t\t\t=========INSERTION IN ARRAY==========";
    cout<<endl<<"\t\t\t\t1.TOP                               ";
    cout<<endl<<"\t\t\t\t2.LAST";
    cout<<endl<<"\t\t\t\t3.KTH";
    cout<<endl<<"\t\t\t\t4.DISPLAY";
    cout<<endl<<"\t\t\t\t5.EXIT";
  }


   void top(int a[15],int &n)
   {
  n=n+1;
  cout<<endl<<"enter the item :";
  cin>>item;
     for(i=n-1;i>0;i--)
     {
a[i]=a[i-1];
     }
     a[i]=item;


   }


    void last(int a[15],int &n)
    {
  n=n+1;
  cout<<endl<<"enter the item :";
  cin>>item;
     a[n-1]=item;
    }
     void display(int a[15],int &n)
     {
      cout<<endl<<"array after insertion is :";
      for(i=0;i<n;i++)
      {
cout<<endl<<"a["<<i<<"] = "<<a[i];
      }


 getch();
     }
      void kth(int a[15],int &n)
      {
cout<<endl<<"enter the kth pos : ";
     cin>>k;
     cout<<endl<<"enter the item to be inserted at kth pos : ";
     cin>>item;
     n=n+1;
     for(int j=n-1;j>=k;j--)
     {
      a[j]=a[j-1];
     }
      a[k]=item;
      }

Linear Search Using C++


#include<iostream.h>
#include<conio.h>
  void main()
  {
   int a[15],n,i,loc,item,chk=0;
   clrscr();
    cout<<endl<<"enter the no of elements :";
    cin>>n;
     cout<<endl<<"enter the elements :";
      for(i=0;i<n;i++)
      {
cout<<endl<<"a["<<i<<"] = ";
cin>>a[i];
      }
    cout<<endl<<"enter the item to be searched :";
    cin>>item;
     for(i=0;i<n;i++)
     {
if(a[i]==item)
{
 loc=i;
 chk=1;
}
     }
      if(chk==1)
      {
       cout<<endl<<"item is present at "<<loc+1<<" loc";
      }
      else
      {
cout<<endl<<"item is not present in the list :";
      }
   getch();
  }

Binary Search Using c++


#include<iostream.h>
#include<conio.h>
  void main()
  {
   int a[15],n,i,loc=-1,item,chk=0,beg,end,mid;
   clrscr();
    cout<<endl<<"enter the no of elements :";
    cin>>n;
     cout<<endl<<"enter the elements :";
      for(i=0;i<n;i++)
      {
cout<<endl<<"a["<<i<<"] = ";
cin>>a[i];
      }
    cout<<endl<<"enter the item to be searched :";
    cin>>item;
    beg=0;
    end=n-1;
     while(beg<=end&&loc==-1)
     {
       mid=(beg+end)/2;
       if(item==a[mid])
       {
 loc=mid;
 chk=1;
 break;
       }
       else if(item<a[mid])
       {
end=mid-1;
       }
       else
       {
beg=mid+1;
       }
     }
      if(chk==1)
      {
       cout<<endl<<"item is present at "<<loc<<" loc";
      }
      else
      {
cout<<endl<<"item is not present in the list :";
      }
   getch();
  }

Postfix To Infix Using c++


#include<iostream.h>
#include<conio.h>
#include<string.h>
#include<stdio.h>
char stack[60],exp[60],p[60];
int tos=-1,m,n,t=1;
void main()
{
void push(char),display(int);
char ch, pop() ;
clrscr();
cout<<"Enter the Expression : ";
gets(exp);
exp[strlen(exp)]=')';
exp[strlen(exp)+1]=NULL;
// puts(exp);
getch();
push('(');
while(tos>-1)
{
switch(exp[m])
{
case'+':
case'-':
while(stack[tos]=='+'||stack[tos]=='-'||stack[tos]=='*'||stack[tos]=='/'||stack[tos]=='^'||stack[tos]=='%')
{
ch=pop();
p[n]=ch;
n++;
//push(exp[m]);
}
//else
push(exp[m]);
break;


case'*':
case'/':
case'%':
while(stack[tos]=='*'||stack[tos]=='/'||stack[tos]=='^'||stack[tos]=='%')
{
ch=pop();
p[n]=ch;
n++;
}
//else
push(exp[m]);
break;


case'^':
while(stack[tos]=='^')
{
ch=pop();
p[n]=ch;
n++;
}
//else
push(exp[m]);
break;
case ')':
while(stack[tos]!='(')
{
ch=pop();
p[n]=ch;
n++;
}
ch=pop();
break;
case '(':
push('(');
break;
case ' ':
default:
//ch=pop();
p[n]=exp[m];
n++;
}
m++;
//cout<<p[n]<<endl;


display(m-1);


}


}


void push(char c)
{
// cout<<"push";
tos++;
stack[tos]=c;
}






char pop()
{
char ch;
if(tos<0)
return(0);
else
{
ch=stack[tos];
stack[tos]=' ';
tos--;
return(ch);
}
}


void display(int aa)
{
//cout<<"\ncheck" ;
if(t==1)
{
cout<<"\n\t Symbol \t\t Stack \t\t\t Postfix Expression ";
cout<<"\n\t ------ \t\t ------\t\t\t -------------------\n";
t++;
}
if(tos==-1)
cout<<"\n\t "<<exp[aa]<<"\t\t\t Empty"<<"\t\t\t"<<p;
else
cout<<"\n\t "<<exp[aa]<<"\t\t\t "<<stack<<"\t\t\t\t"<<p;






cout<<endl;
getch();
}



Creating Package Using JAVA


package society;


public class Human
{
 public static void main(String arg[])
{
             Human t=new Human();
             t.hello();            


       }


    void hello()
  {
    System.out.println("hello");
  }


}

Use Of Scanner Class Function In JAVA


import java.util.Scanner;


public class Ar
{
   public static void main(String arg[])
 {
      int[] n=new int[10];
Scanner in=new Scanner(System.in);
System.out.println("Enter the elements : ");
      int i=0;

for(i=0;i<10;i++)
{
System.out.print("Enter the element a[ : "+ i +"] = ");
n[i]=in.nextInt();
}
for(i=0;i<10;i++)
{
System.out.println("elements are  a[ : "+ i +"] = "+n[i]);

}


   
 }
}

Coloring With JAVA


import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Draw implements ActionListener
{
JFrame f;

JButton b1;
JButton b2;
JButton b3;
JLabel lb;
public Draw()
{
f=new JFrame();
b1=new JButton("RED");
b2=new JButton("GREEN");
b3=new JButton("ORANGE");
lb=new JLabel();

Shape s=new Shape();

b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);

f.add(BorderLayout.CENTER,s);
lb.setForeground(Color.white);
f.add(BorderLayout.NORTH,lb);
f.add(BorderLayout.SOUTH,b1);
f.add(BorderLayout.WEST,b2);
f.add(BorderLayout.EAST,b3);

f.setVisible(true);
f.setSize(400,400);
}
public void actionPerformed(ActionEvent ae)
{

}
public void paintComponent(Graphics g)
{
g.setColor(Color.red);
g.fillRect(20,30,110,110);
}
public static void main(String[] args)
{
Draw a=new Draw();
}


}

CSS Implementation


body {
margin: 0;
padding: 0;
line-height: 1.5em;
font-family: Verdana, Arial, san-serif;
font-size: 11px;
color: #ffffff;
background: #4b4743;
}


a:link, a:visited { color: #e6e154; text-decoration: none; font-weight: bold;} 
a:active, a:hover { color: #e6e154; text-decoration: underline;}


p {
margin: 0px;
padding: 0px;
}


img {
margin: 0px;
padding: 0px;
border: none;
}




.cleaner {
clear: both;
width: 100%;
height: 1px;
font-size: 1px;
}


.cleaner_with_height {
clear: both;
width: 100%;
height: 30px;
font-size: 1px;
}


.cleaner_with_width {
float: left;
width: 20px;
height: 30px;
font-size: 1px;
}


.buy_now_button a{
clear: both;
text-align: center;
display: block;
width: 100px;
padding: 4px 0 5px 0;
margin-bottom: 10px; 
background: url(images/templatemo_btn_02.jpg) no-repeat;
color: #FFFFFF;
font-weight: bold;
text-decoration: none;
}


.detail_button a{
clear: both;
text-align: center;
display: block;
width: 100px;
padding: 4px 0 5px 0;
margin-bottom: 10px; 
background: url(images/templatemo_btn_01.jpg) no-repeat;
color: #ffffff;
font-weight: bold;
text-decoration: none;
}


#templatemo_container{
width: 960px;
margin: 0 auto;
padding: 0 10px;
background: #1c1c1b url(images/templatemo_bg.jpg) repeat-y;
}

Stack Implemenation Using C++


#include<iostream.h>
#include<conio.h>
#include<process.h>
#include<dos.h>
#include<graphics.h>
 int stack[50],n,tos=0;


 void main()
 {
   int i,o;
   void menu();
   void push();
   void pop();
   void display();
   clrscr();
    cout<<endl<<"ENTER THE NO. OF ELMENTS :";
    cin>>n;
    while(1)
    {
       menu();
       cout<<endl<<endl<<"ENTER YOUR CHOICE :";
       cin>>o;
       switch(o)
       {
case 1:
push();
break;
case 2:
pop();
break;
case 3:
display();
break;
case 4:
cout<<endl<<endl<<"EXITING. . . .";
delay(1000);
exit(0);
default:
cout<<endl<<endl<<"WRONG CHOICE. . .TRY AGAIN. . ";
getch();
       }
    }
//   getch();
 }
  void menu()
  {
    clrscr();
    cout<<endl<<endl<<"\t\t\t\t=========STACK OPERATIONS==========";
    cout<<endl<<"\t\t\t\t1.PUSH                               SIZE = "<<n;
    cout<<endl<<"\t\t\t\t2.POP";
    cout<<endl<<"\t\t\t\t3.DISPLAY";
    cout<<endl<<"\t\t\t\t4.EXIT";
  }


   void push()
   {
     if(tos>=n)
     {
       cout<<endl<<endl<<"SORRY STACK IS FULL. . OVERFLOW. . .";
       getch();
     }
     else
     {
       ++tos;
       int v;
       cout<<endl<<endl<<"ENTER THE VALUE TO BE INSERTED IN STACK : ";
       cin>>v;
       stack[tos]=v;
     }
   }


    void pop()
    {
      if(tos==0)
      {
cout<<endl<<endl<<"SORRY STACK IS EMPTY. . . UNDERFLOW. . .";
getch();
      }
      else
      {
tos--;
      }
    }
     void display()
     {
int i;
 if(tos==0)
 {
 cout<<endl<<endl<<"NO ELEMENTS TO DISPLAY. . . USE PUSH TO INSERT";
 }
 else
 {
  cout<<endl<<endl<<"\t\tELEMENTS IN STACK ARE . . . .                 TOS = "<<tos;
//   cout<<tos;
   for(i=tos;i>=1;i--)
   {
     cout<<endl<<endl<<"\t\t\tSTACK["<<i<<"] = "<<stack[i];
   }
 }
 getch();
     }

How To Implement Concept Of Virtual Function


#include<iostream.h>
#include<conio.h>
 class base
 {
 public:
  virtual void show()
  {


   int a=10;
    cout<<a;
  }
 };
  class der:public base
  {
     public:
     void show()
     {
       int b=20;
       cout<<b;
     }
  };
 void main()
 {
  clrscr();
   base *ptr;
   der k;
   ptr=&k;
   ptr->show();
  getch();
 }

How To Use If Block In PL/SQL


declare
a varchar2(30);
b varchar2(30);
c number(10);
t number(10,2);
begin
select ename,job,sal into a,b,c from emp where empno=7369;
if b='mgr' then
t:=c+(10/100)*c;
elsif b='president' then
t:=c+(20/100)*c;
elsif b='clerk' then
t:=c+(5/100)*c;
elsif b='peon' then
t:=c+(2/100)*c;
else
t:=0;
end if;
dbms_output.put_line('old sal is'||c);
dbms_output.put_line('new sal is'||t);
dbms_output.put_line('job is'||b);
end;

How To Use Cursor In PL/SQL


set serveroutput on
declare
cursor c1 is
select employee_id,first_name,job_id,salary from employees;
a employees.employee_id%type;
b employees.first_name%type;
c employees.job_id%type;
d employees.salary%type;
begin
open c1;
if c1%isopen then
loop
fetch c1 into a,b,c,d;
dbms_output.put_line(a || b||  c|| d);
exit when c1%notfound ;
end loop;
else
dbms_output.put_line('cursor not open');
end if;
close c1;
end;
/



Concept Of Friend Function In C++


#include<iostream.h>
#include<conio.h>
 class frnd
 {
   int a,b,c;
   public:
   frnd(int x,int y)
   {
      a=x;
      b=y;
   }
 friend void sum(frnd k)
    {
     k.c=(k.a+k.b);
     cout<<"\nsum is : "<<k.c;
   }
 };
  
 void main()
 {
   clrscr();
   int a,b;
   cout<<"\nenter the value of 1st no : ";
   cin>>a;
   cout<<endl<<"enter the value of 2nd no. : ";
   cin>>b;
   frnd k(a,b);
   sum(k);
   getch();
 }

Insert Element At First Position In A Link List


#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
struct ll
{
     int info;
     struct ll *p;
   };
struct ll *start,*ptr;
void main()
{       clrscr();
     void infirst(ll*);
     void create (ll*);
     void print(ll*);
     start=(ll*) malloc(sizeof(ll));
     ptr=start;
     create(ptr);
       cout<<"START---->";
       print(ptr);
     infirst(ptr);
     cout<<"LINK List BECOMES:";
     print(ptr);
     getch();
}
void create (struct ll *m)
{
   char ch;
   cout<<"\n ENTER THE INFO PART:";
   cin>>m->info;
   cout<<"\n DO YOU WANT ANOTHER NODE(yes-'y' or no-'n')";
   cin>>ch;
   if(ch=='n'||ch=='N')
   {
m->p=NULL;
return;
   }
   else
   {
      m->p=(ll*)malloc(sizeof(ll));
      create(m->p);
   }
}
void print(struct ll *m)
{


    if(m->p==NULL)
    {
cout<<m->info<<"--->X";
return;
     }
     else
     {
cout<<m->info<<"---->";
print(m->p);
       }
  }
  void infirst(ll *m)
  {
struct ll *new1;
new1=(ll *)malloc(sizeof(ll));
cout<<"\n ENTER THE ITEM IN THE NODE";
cin>>new1->info;
if(m->p==NULL)
{
    new1->p=NULL;
    ptr=new1;
 }
 else
 {
      new1->p=m;
      ptr=new1;
   }


       }

Radix Sort


#include<iostream.h>
#include<process.h>
#include<conio.h>
int a[50];
void radix(int *a,int);
main()
{
int i,n;
clrscr();
cout<<"\n Enter The Size of given List : ";
cin>>n;
cout<<"\n Enter the elements of List :";
for(i=0;i<n;i++)
{
cout<<"\n A["<<i<<"]= ";
cin>>*(a+i);
}
radix(a,n);
for(i=0;i<n;i++)
{
cout<<"\n A["<<i<<"]= "<<a[i];
}
getch();
}




void radix(int *a,int n)
{
int rad[10][20],c[10],i,j,k,r,dc=0,div=1,lar,pno;
lar=a[0];
for(i=1;i<n;i++)
{
if(a[i]>lar)
{
lar=a[i];
}
}
while(lar>0)
{
dc++;
lar=lar/10;
}
for(pno=0;pno<dc;pno++)
{
for(k=0;k<10;k++)


c[k]=0;
for(i=0;i<n;i++)
{
r=(a[i]/div)%10;
rad[r][c[r]++]=a[i];
}


i=0;
for(k=0;k<10;k++)
{
for(j=0;j<c[k];j++)
{
a[i++]=rad[k][j];
}
}
div=div*10;
}
}

QuickSort


#include<iostream.h>
#include<conio.h>
int a[50],upper[50],lower[50],utos,ltos,n,beg,end;
int upop(int *);
void upush(int *,int);
int lpop(int *);
void lpush(int *,int);
int quick(int *,int,int);
void main()
{
clrscr();
int loc1;
cout<<"\n Enter number of elements:";
cin>>n;
cout<<"\n Enter array:\n";
for(int i=1;i<=n;i++)
{
cout<<" a["<<i<<"]: ";
cin>>a[i];
}
beg=1;
end=n;
lpush(lower,beg);
upush(upper,end);
while(utos>0)
{
beg=lpop(lower);
end=upop(upper);
loc1=quick(a,beg,end);
if(beg<(loc1-1))
{
lpush(lower,beg);
upush(upper,(loc1-1));


}
if(end>(loc1+1))
{
lpush(lower,(loc1+1));
upush(upper,end);
}
}
cout<<"\n Sorted List:\n";
for(i=1;i<=n;i++)
{
cout<<"\n a["<<i<<"]: "<<a[i];
}


getch();
}
void upush(int *a,int item)
{
utos=utos+1;
a[utos]=item;
}
void lpush(int *a,int item)
{
ltos=ltos+1;
a[ltos]=item;
}
int upop(int *a)
{    int item;
item=a[utos];
utos=utos-1;
return(item);
}
int lpop(int *a)
{
int item;
item=a[ltos];
ltos=ltos-1;
return(item);
}


int quick(int *a,int beg,int end)
{
int left,right,temp,loc;
left=beg;
right=end;
loc=beg;
rtol:while((a[loc]<=a[right])||(loc!=right))
{
if(loc==right)
{
return(loc);
}
else
{
if(a[loc]>a[right])
{
temp=a[loc];
a[loc]=a[right];
a[right]=temp;
loc=right;
goto ltor;
}
}
right =right-1;
}
ltor: while(a[left]<=a[loc]||left!=loc)
{
if(loc==left)
{
return(loc);
}
else
{
if(a[left]>a[loc])
{
temp=a[loc];
a[loc]=a[left];
a[left]=temp;
loc=left;
goto rtol;
}
}
left=left+1;
}
}

Bubble Sort Using Pointer's


#include<iostream.h>
#include<conio.h>
#include<process.h>
 void main()
{
clrscr();
cout<<"ENTER NUMBER OF ELEMENTS IN ARRAY ";
cin>>n;
cout<<"\n\nENTER ELEMENTS OF ARRAY ";
input(a,n);
cout<<"\n\nELEMENTS OF ARRAY ARE\n";
output(a,n);


cout<<"**********BUBBLE SORT**********\n\n";
int i,temp,j;
for(i=1;i<n;i++)
{
for(j=0;j<(n-i);j++)
{
if((*(a+j))>(*(a+j+1)))
{
temp=(*(a+j));
(*(a+j))=(*(a+j+1));
(*(a+j+1))=temp;
}
}
cout<<"\n";
output(a,n);
getch();
}
cout<<"\n\nARRAY SORTED.....";
getch();
}


void input(int *a,int n)
{
int i;
for(i=0;i<n;i++)
cin>>(*(a+i));
}
void output(int *a,int n)
{
int i;
for(i=0;i<n;i++)
PAGE :16
cout<<(*(a+i))<<" ";
}

Use The Following Code To Copy The Selected Text Onto Clipborad


My.Computer.Clipboard.SetText(TextBox1.SelectedText)

Connection String Can Be Used In VB.NET

Dim Con as new Sqlconnection("server=kamal;Integrated Security=True;Database='music' ")

How To Fix A Background Using Css

style="background-attachment:fixed;" background="1.jpg"

Simple Script To Print Something


<script type="text/javascript" language="JavaScript">
   document.writeln( "Hello World" );
</script>

How To Change Color Of Background


<html>
<Body onload="changeBackground('red');">
</body>
</html>

How To Change Background Color Using Javascript

<html>
<body>
<script>
document.bgColor="#CCCCCC";
</script>
</body>
</html>

How To Rotate Element Using CSS3


Copy And Paste . . . . Enjoy
<html>
<style>
#d1
{
background:red;
height:300;
width:300;
float:left;
overflow:hidden;
-webkit-transform:rotate(7deg);
}
</style>
<body>
<div  id="d1" >
Kamal Vaid
</div>
</body>
</html>

How To Use Prompt Box In Javascript


Copy And Paste . . .Enjoy
<html>
<head>
<script type="text/javascript">
function con()
 {
       var name=prompt("Please enter your name","Kamal Vaid");
               if (name!=null && name!="")
              {
                     var   x="Hello " + name + "! How are you today?";
             }
}
</script>
</head>
<body>
<form>
<input type="button" onclick="con()" value="Kamal site">
</form>
</body>
</html>

How To Use Confirm Box In Javascript

Copy And Paste . . . Enjoy
<html>
<head>
<script type="text/javascript">
function con() {
var answer = confirm("Do You Wanna Leave kamal World?")
if (answer){
alert("Bye bye!")
window.location = "http://www.google.com/";
}
else{
alert("Thanks for sticking around!")
}
}
</script>
</head>
<body>
<form>
<input type="button" onclick="con()" value="Kamal site">
</form>
</body>
</html>

Code To Upload A File Using PHP

Step I : First Create a Page In Html For Uploading (Try The Following Code In Order To So)
<html>
<body bgcolor='black'>
<table  align="center">
<tr>
<td>
<form action="fileupload.php" method="post"  enctype="multipart/form-data" >
<font color="#0d8ffe" size="2" ><u>File Upload</u></font>&nbsp;&nbsp;&nbsp;<input name="file" type="file" class="pimg1"  />
 &nbsp;&nbsp;<input type="submit" value="Upload" style="background:#0d8ffe;border:0;"/>
</form>
</td>
</tr>
</table>
</body>
</html>

Step II : Then Use The Following Function To Move The file To Desire Locaton.



<?php 
if(empty($_FILES["file"]["name"]))
{
header("Location:entry.php");
exit;
}
require "comm.php";


$filename = $_FILES["file"]["name"];
               $name=split("\.",$filename);
      $nm = $name[0];
     $ext = $name[1];



move_uploaded_file($_FILES["file"]["tmp_name"],"$nm.$ext");
?>

Connection String For PHP And Mysql


<?php
$link = mysql_connect('localhost', 'root','Database_name');
?>

Program To Enter Elements At Various positions In an Array Using Pointers . . .


#include<iostream.h>
#include<conio.h>
void insert_top(int *,int &,int);
void insert_end(int *,int &,int);
void insert_k(int *,int &,int);
int *ptr,*s,item,i;
int n=0;
 void main()
 {
     clrscr();
     s=ptr;
     cout<<endl<<"enter the no. of elements :";
     cin>>n;
     cout<<endl<<"enter the elements :";
for(i=1;i<=n;i++)
{
cout<<endl<<"enter a["<<i<<"] =";
cin>>*(ptr+i);
}
     cout<<endl<<"u ve entered ";
   for(i=1;i<=n;i++)
   {
    cout<<endl<<"a["<<i<<"] = "<<*(ptr+i);
   }
   cout<<endl<<"enter the item : ";
   cin>>item;
    insert_top(ptr,n,item);
    insert_end(ptr,n,item);
    insert_k(ptr,n,item);
    getch();
 }
  void insert_top(int *ptr,int &n,int item)
  {
  cout<<endl<<"n="<<n;
  n=n+1;
  cout<<endl<<"n="<<n;
  int r;
  int *o;
     for(i=n;i>=1;i--)
     {     o=(ptr+i);
   r=*(ptr+(i-1));
   *o=r;
     }
      o=(ptr+i+1);
      *o=item;
      for(i=1;i<=n;i++)
      {
cout<<endl<<"a["<<i<<"] = "<<*(ptr+i);
      }
   }
    void insert_end(int *ptr,int &n,int item)
    {
     cout<<endl<<"n="<<n;


       n=n+1;
       cout<<endl<<"n="<<n;
       int *o;
       o=(ptr+n);
       *o=item;
       for(i=1;i<=n;i++)
       {
cout<<endl<<"a["<<i<<"] = "<<*(ptr+i);
       }
    }
     void insert_k(int *ptr,int &n,int item)
     {
int k;
int *o,r;
n=n+1;
cout<<endl<<"enter the kth pos :";
cin>>k;




for(i=n;i>=k;i--)
{
    o=(ptr+i);
    r=*(ptr+i-1);
    *o=r;
}
*(ptr+k)=item;
for(i=1;i<=n;i++)
{
  cout<<endl<<*(ptr+i);
 }
 }

Simple Program To Implement Array Using Poiners . .


#include<iostream.h>
#include<conio.h>
 void main()
 {
    int *ptr,*a,i;
    *ptr=10;
    a=ptr;
    clrscr();
    cout<<ptr<<endl<<a;
     int n;
     cin>>n;
     cout<<endl<<"enter the elements :";
     for(i=0;i<n;i++)
     {
      cin>>*ptr;
      ptr++;
      }
      ptr=a;
      cout<<"\nu ve entered :";
      for(i=0;i<n;i++)
      {
cout<<*ptr;
ptr++;
}
    getch();
 }