Showing posts with label php. Show all posts
Showing posts with label php. Show all posts

Wednesday, July 17, 2013

WAMP SERVER INSTALLATION ON WINDOWS 7 32/64 BIT

WAMP SERVER INSTALLATION ON WINDOWS 7 32/64 BIT


WAMP (Windows, Apache, mySQL, PHP) is all in one packages which installs the basic programs, you will need to get a localhost running and to be able to build and run PHP scripts.
We have already lived a tutorial about the installation guide for Wamp Server 2.1 a and this is the fresh and new WampServer 2.1 d version installation guide. This WAMP server installation tutorial helps you to tune the server without the need of touching the configuration files. Once the WAMP server installation completes successfully, you have the trayicon for the management of server and all its settings. You can visit Hostgator review to have an idea about website hosting.
If you are installing WampServer 2.1 d first time, then these following step will help you that how to install the WampServer 2.1 d in your computer with windows 7. We will end up to the following applications at the tail of this tutorial,
  • Installation of Wamp Server 2.1 d
  • Apache 2.2.17
  • PHP 5.3.4
  • Mysql 5.1.53 (version 64 bits)
  • Mysql 5.5.8 (version 32 bits)
  • phpMyadmin 3.2.0.1
  • SQLBuddy 1.3.2
Let’s start from scratch to build PHP environment on windows 7 64 bits operating system by using WampServer 2.1 d.

WampServer Official Site

This awesome server can be found for download at official web page WampServer. Let’s Run through the Installation first and then I’ll go in to detail about the administration.
              
                   

Step 1

You will find two options for the selection of WampServer for your windows 7 after clicking on “Download” link at the main navigation of WampServer official site.
My windows 7 is 64 bit, so I will proceed with the download of WampServer 2.1 d 64 bits version.

          

Step 2

I am using Google Chrome for the presentation of this tutorial, so you will notice “Save” button at the lower left corner of the browser. There will be “Save Dialog” in case of Mozilla Firefox and Internet Explorer.

Step 3

Click on Save button, WampServer is starting to download after clicking on the save button. You can save WampServer file in any location in your hard drive.

         

Step 4

Downloading of WampServer 2.1d is complete, and you will notice WampServer icon at your download location.

           

Step 5

It is the time to install WampServer on our windows. You will receive a Security Warning after opening WampServer file. It is absolutely normal to run WampServer setup on windows.

                 
Installation Starting of WampServer

Step 7

You will see a standard setup wizard of windows after clicking Run button on security warning dialog.

           
WampServer 2 Setup Wizard

Step 8

You have to agree the license of WampServer before selecting installation destination at your windows machine.

                   
License Agreement

Step 9

It is very important step of WampServer installation. I will recommend to install WampServer at the drive other than Windows 7 installation. Suppose your Windows 7 is install in C drive so you should install WampServer on D, E or any other location in hard drive except C drive.
I am going to install WampServer in D drive. Now you can click on Next button after selecting installation location for WampServer 2.1d
.
           
Select Destination Location of WampServer

Step 10

When you click on the Next button then a Select Additional Tasks dialog will appear on your screen, if you would like setup to perform while installing WampServer 2. You can check following options,
  • Create a Quick Launch icon
  • Create a Desktop icon
I have not interested to create any icon in the above locations, but you can do. You will be at “Ready  to Install” window after clicking Next button.
         
                   
Select Additional Tasks

Step 11

Setup is now ready to begin installing WampServer 2.1d on your computer. Click on Install button to start installation of WampServer 2.1d.
     
               
WampServer 2.1d Ready to Install

Step 12

Now your WampServer is starting to install in your computer.
     
                
WampServer Installing

Step 13

You will receive a dialog for choosing your default browser for WampServer. You can choose your favorite browser for WampServer as default, or simply click “Open” if you are not sure about the installation or executable files of your favorite browser. WampServer will choose “Internet Explorer” as default choice.
  
            
Choice of Default Browser

Step 14

WampServer installation has completed now and setup will guide you for Apache configurations in the next steps.
  
          
Complete The Installation

Step 15

You will notice a “Windows Firewall” standard dialog while configuring Apache by WampServer. (You may not observe this, if your windows firewall is not active). Click on “Allow Access” by leaving default options as such to proceed for PHP mail parameters.

            
Apache HTTP Server

Step 16

After allowing access to Apache server, you are at SMTP server configuration dialog. You can specify the SMTP server and the address mail to be used by PHP when using the function mail(). I will recommend the following values,
  • SMTP: localhost
  • Email: Your email address.
Click “Next” after putting the above values for the installation final dialog.


                 
PHP Mail Parameters

Step 17

You have successfully installed WampServer 2.1 d along with Apache, MySql, PHP, phpMyAdmin and SqlBuddy at your computer.
Click “Finish” to start WampServer along with other services. Leave “Launch WampServer 2 now” check-box checked to start WampServer automatically after installation.

                     
WampServer 2 Setup Wizard Completion

Step 18

Now you can see WampServer icon on the taskbar. WampServer icon has three states.
  • Red
  • Yellow
  • Green
Red:
WampServer red icon is showing that WampServer is Offline and no service has been started yet i.e Apache, PHP and MySql.

         
WampServer Offline
Yellow:
WampServer red icon is show that WampServer is still Offline and any service among Apache, PHP and MySql has been failed to start.

              
WampServer is Still Offline
Green:
WampServer is working normal along with all services and your development server is ready to use.

                  
Green WampServer Icon

Step 19

It is time to test our WampServer with the installed services of Apache, PHP, MySql and phpMyAdmin. Please follow the steps to test WampServer at Windows 7.
  • Be sure, WampServer icon is green at taskbar
  • Open your favorite browser
  • Type, http://127.0.0.1/ OR http://localhost/
  • Hit Enter
You have successfully installed WampServer on your computer if you have seen the welcome screen of WampServer. You can read Server Configuration at WampServer welcome screen.
  • Apache Version: 2.2.17
  • PHP Version: 5.3.4
  • Loaded Extensions: Loaded extensions of PHP
  • MySql Version: 5.1.53 – It will be Mysql 5.5.8 at 32 bits platform.

              
WampServer Welcome Screen

Step 20

You can launch phpMyAdmin console by one of the following means,
  • Click on phpmyadmin link on WampServer welcome screen
  • Type: http://127.0.0.1/phpmyadmin/ OR http://localhost/phpmyadmin/ in the browser address bar
  • Hit Enter
You will be at phpMyAdmin index to manage your MySql databases.

              
phpMyAdmin
I hope you have successfully installed WampServer 2.1 d at your computer. If you have any question, feel free to ask and don’t forget to write your valuable comments.


keep sharing enjoy learning...!!

Read More
18 comments:

Wednesday, February 20, 2013

Show Message Box in Php using Javascript

Most of the User wants to show message box after some process happens in Webpage.
But in Php you can't show message box like you have done in javaScript.
But you can use javascript in php to show message box.

This code is use to show message box in Php file using javascript.

<?php
..... ..  your php code......


echo "<script type='text/javascript'>\n";
echo "alert('you are Succesflly registered');\n";
echo "</script>";

>



Read More
26 comments:

PHP to MySql Database connection in WAMP Server

WAMP is an acronym formed from the initials of the operating system Microsoft Windows and the principal components of the package: Apache, MySQL and one of PHP, Perl or Python. Apache is a web server. MySQL is an open-source database. PHP, Perl and Python are scripting languages that can manipulate information held in a database and generate web pages dynamically each time content is requested by a browser. Other programs may also be included in a package, such as phpMyAdmin which provides a graphical user interface for the MySQL database manager.


Setpwise  Procedure to Create webpage ,Connect to database  and Inserting data.

1-Install Wamp Server On PC. You can Get Installation tutorial on any website.

2- Now Start the Wamp Server and  do right click and click on phpmyadmin .

PhphMyadmin page will open and clikc on New database and create new database with uyour name



Now Create new table name as info with two field name as first and last





remaing  field let it be empty.


We are done with database .Now Create Web page


3- Make Simple webpage with two textbox... First Name and Last Name

code of html page-

<html>
<head>
</head>
<body>
<h1>My First Php Web Page</h1>

<form action="insert.php" method="post">
First Name: <input type="text" name="first"><br>
Last Name: <input type="text" name="last"><br>
<input type="Submit">
</form>
</body>
</html>
Save this file as index.html


Step 2-  Make Php File Which Handle that request-

<?php
$database="jayesh"; //database name
$first=$_POST['first'];//this values comes from html file after submitting
$last=$_POST['last'];
    $con = mysql_connect("localhost","root" ,"");//for wamp 3rd feild is balnk
    if (!$con)
    {
    die('Could not connect: ' . mysql_error());
    }
    mysql_select_db("$database", $con);

$query = "INSERT INTO info (first,last)VALUES ('$first','$last')";
mysql_query($query);

echo "<script type='text/javascript'>\n";
echo "alert('you are Succesflly registered');\n";
echo "</script>";


mysql_close();
?>


save this file as insert.php.

3-Put this both file in single Folder and Put this folder in Wamp installation directory, inside  WWW folder

defalut path is =C:\wamp\www\


4- Now again  do right click and click on local host . Main Page of wampserver will open.

On bottom left of project you will find directory in which we store both file. Click on that folder

Our index.html page will open
It will  Look Like this--->





Now Enter the details and and Submit it. Message box will come that you successfully insert data in database , in that way you can try for delete and modify operation.

Keep Sharing and Comment if any Difficulty...


Read More
73 comments: