Tuesday, 21 July 2015

How to install Wamp Server

1.  Download WAMP Server 

     I'll give you simple steps for 'Installation of WAMP Server'. We need to download the WAMP Server Package .exe file from official WAMP Server Page. Choose file with Config of your system.


after selection your file . It'll ask following Popup.Don't worry about this . Just click 'you can download it directly '


  2. Start Setup Wizard
        
         you'll get below Setup Wizard window, When you Run WAMP Server .exe file . It shows config of WAMP . Click 'Next' button to continue.


You should agree the license of WAMPServer before Installation of WAMP Server.

 

 3. Select Destination and Icon
     Here, You should select the Server Location. Most of the server installing into C drive only. Me too installing into C drive . You can browse any other location and click 'Next'.


 And choose which Icons you want.


4. Installing and Complate
    In 'Ready to Install' window, just click 'Install' button.

 

 Now wait up-to finish the installing.

 

 In following window,just leave Default value and Click 'Next'


Now Installation Process is almost done. Tic the Launch and Finish it.

 
 5. Run WAMP Server
     Just double click the WAMP Server icon. You'll get following small icon in TAskBar. First it;s color is Red and change to Orange. At-last it goes to Green color. If green color comes, Your WAMP Server running successful.


 
 Now see your WAMP Server Home Page with following URL 'http://localhost/'.

 



How to Install DreamWeaver on your System

There are step-by-step instructions on how to install Adobe Dreamweaver CS4 version on your computer.

You can download the Adobe Dreamweaver CS4 Trial version from the Macromedia/Adobe official web site.

if you have already purchased the full version of Adobe Dreamweaver CS4, You can enter its serial number at the initial installation screen.


Next, you should agree to the Adobe Software License Agreement.


Once you have done that, follow the instructions in the setup program in order to finish the installation of Adobe DreamweaverCS4.

Monday, 20 July 2015

How to Declare Variable in PHP

Step:1 Open Dreamweaver.

Step:2 Create PHP Page




Step:3 Coding ..

<!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=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
   $x=5;
   $y=6;
   echo"<center><h3> A=$x </h3></center>";
   echo"<center><h3> B=$y </h3><center>";
   $z=$x+$y;
   echo "<center><h2> Ans=$z</h2></center>";
?>
</body>

</html>


Step:4 Save it on C drive=> wamp folder => www folder => name your folder

Step:5 To Run Open wampmanager= > local host



Step:6 Go to Your Project and Select your Folder Name and Click your example and see your output.


How to Declare Static Variable in PHP

Step:1 Open Dreamweaver.

Step:2 Create PHP Page.




Step:3 Coding ..

<!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=utf-8" />
<title>Untitled Document</title>
</head>

<body>
/* Static Scope
When a function is completed, all of its variables are normally deleted. However, sometimes you want a local variable to not be deleted.

To do this, use the static keyword when you first declare the variable: */

<?php
function myTest()
{
    static $x=0;
    echo "<center>$x</center>";
    $x++;
}

myTest();
myTest();
myTest();

?>
</body>

</html>

Step:4 Save it on C drive=> wamp folder => www folder => name your folder

Step:5 To Run Open wampmanager= > local host


Step:6 Go to Your Project and Select your Folder Name and Click your example and see your output.


How to Declare Local Variable in PHP

Step:1 Open Dreamweaver.

Step:2 Create PHP Page




Step:3 Coding ..

<!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=utf-8" />
<title>Untitled Document</title>
</head>
<body>

/* Local Scope
A variable declared within a PHP function is local and can only be accessed within that function: */

<?php

$x=5;   //global scope

function myTest()
{
     echo $x;   //local scope
}

?>
</body>

</html>

Step:4 Save it on C drive=> wamp folder => www folder => name your folder

Step:5 To Run Open wampmanager= > local host


Step:6 Go to Your Project and Select your Folder Name and Click your example and see your output.




Global Example in PHP

Step:1 Open Dreamweaver.

Step:2 Create PHP Page.




Step:3 Coding ..

<!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=utf-8" />
<title>Untitled Document</title>
</head>

/* Global Scope
A variable that is defined outside of any function, has a global scope.

Global variables can be accessed from any part of the script, EXCEPT from within a function.

To access a global variable from within a function, use the global keyword: */

<body>

<?php

$x=5; // global scope
$y=10; // global scope

function myTest()
{
      global $x,$y;
      $y=$x+$y;
}

myTest();
echo "<br><center><h2>$y</h2></center></br>"; // outputs 15

?>
</body>

</html>


Step:4 Save it on C drive=> wamp folder => www folder => name your folder.

Step:5 To Run Open wampmanager= > local host.



Step:6 Go to Your Project and Select your Folder Name and Click your example and see your output.



ODD and Even in PHP

Step:1 Open Dreamweaver.

Step:2 Create PHP Page.




Step:3 Coding ..

<!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>ODD EVEN</title>
</head>
<?php

$i;
$odd=0;
$even=0;

echo '<center>'."ODD...........EVEN".'<br>';
for($i=1;$i<=100;$i++)
{
if($i%2==1)
{
               $odd=$odd+$i;
}
else
{
$even=$even+$i;
}
}
echo "&nbsp;&nbsp;&nbsp;."."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.".'<br>';
echo "&nbsp;&nbsp;&nbsp;."."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.".'<br>';
echo "&nbsp;&nbsp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nbsp;&nbsp;.".'<br>';


echo $odd.'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
echo $even;


?>
<body>
</body>

</html>

Step:4 Save it on C drive=> wamp folder => www folder => name your folder

Step:5 To Run Open wampmanager= > local host


Step:6 Go to Your Project and Select your Folder Name and Click your example and see your output.



Reverse Number in PHP

Step:1 Create Php Page



Step:2 Coding


<!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>Untitled Document</title>
</head>
<form name="form1" method="get" >
<body>
<input name="txt1" type="text" value="" />
<input type="submit" value="Click Here !!!" name="btn1" />
</body>

<?php


if(isset($_GET['btn1']))
{
for($i=0;$i<=$_GET['txt1'];$i++)
{
$no=$_GET['txt1']%10;
echo $no;
$_GET['txt1']=$_GET['txt1']/10;
}

}

?>

</html>

Step:3 Save it on C drive => wamp folder => www folder => name your folder

Step:4 For Run Click on wampmanager


Step:5 Now Select Your Project and Run it



Array Example in PHP

Step:1 Create Php Page


 

Step:2 Coding

<!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>Array</title>
</head>
<?php

$a=array("10","x"=>20);

echo "Numeric array :- ".$a[0].'<br>';//Numeric array method
echo "Assosiative array :- ".$a["x"];//assosiative array method

?>
<body>
</body>
</html>

Step:3 Save it on C drive => wamp folder => www folder => name your folder

Step:4 For Run Click on wampmanager


Step:5 Now Select Your Project and Run it



Display 1 to 100 Addition in Php

Step:1 Create Php Page


Step:2 Coding

<!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>Untitled Document</title>
</head>

<?php

$sum=0;
$i;

for($i=0;$i<=100;$i++)
{
$sum=$sum+$i;
}
echo '<font color=red size=+3>'."Sum of 1 to 100 is :".$sum.'</font>';


?>
<body>
</body>
</html>

Step:3 Save it on C drive => wamp folder => www folder => name your folder

Step:4 For Run Click on wampmanager


Step:5 Now Select Your Project and Run it 


Display 1 to 100 Numbers in PHP

Step:1 Open Dreamweaver.

Step:2 Create PHP Page


Step:3 Coding ..

<!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>Untitled Document</title>
</head>
<font color="red" size="+2">
<?php
$i;

echo "<center>"."1 to 100 number "."<br>"."--------------------"."<br>";

for($i=1;$i<=100;$i++)
{
echo $i."<br>";
}

?>

<body>
</body>
</html>


Step:4 Save it on C drive=> wamp folder => www folder => name your folder

Step:5 To Run Open wampmanager= > local host 

Step:6 Go to Your Project and Select your Folder Name and Click your example and see your output