Friday, April 27, 2012

Working With Dreamweaver and PHP (IDE)

Working With Dreamweaver and PHP (IDE)

 

Dreamweaver is considered a WYSIWYG (what-you-see-is-what-you-get) program because of its visual interface. What sets Dreamweaver apart from many other design tools is its tag editing features. For this reason Dreamweaver is usually the preferred tool for developers who are proficient in HTML/PHP.

In addition to always having an HTML/PHP code window just a click away, Dreamweaver also has a built in tag editor, an option to use an external HTML/PHP editor

Getting started with Dreamweaver

Dreamweaver is an HTML editing software made by a company called Macromedia. If you are thinking about buying an HTML editing product, I'd recommend this one. But in the short-term, you can try it out for yourself for 30 days for free. Here's how to get started with that:
 Dreamweaver Code view

 before starting working with PHP you must have Apache server running for Uploading the PHP file
and when you work with Dreamweaver you should define the site (server ) for working smoothly

Working in Localhost server

1)First you have to Create on Dreamweaver site as given below

2)give site name and URl (as we are working with localhost , give name and URL as shown below)



3)Select server technology - PHP, MySQL


 if you do not have apache server running , pls insatll one (  http://umeshnarayanan1983.blogspot.in/2012/04/what-is-php-php-stands-for-p-hp-h.html)

here i have selected  C:\AppServ\www (that one is the web content folder in AppServe)

4)Select Local folder


5)Select remote folder  (here we are working with Localhost, give the same location given above,C:\AppServ\www), ( if you have any external server then you can give that details too , if so skip the steps up to 7 and go to step 8)


6)then check the URL of your site http://localhost/




7)then your Content in the server is availabel in Dreamweaver for editting

if you have and external server you can configure as given below, if you dont have an external server for hosting please register one (registering an  external server for hosting - http://umeshnarayanan1983.blogspot.in/2012/04/uploading-php-files-to-external-server.html)
8) Working in remote  server

give the server details (FTP login details and Directory) 

details i given here 
 FTP Server/Host:       orgfree.com
 FTP Login/Username:       myphpsite.orgfree.com
 FTP PassWord:       ********
your account created successfuly


give the URLand test it



now you can run  Dreamweaver.  here you can view the remote and local vie of the files

my Site local view in  Dreamweaver.

 my Site Remote  view in  Dreamweaver.


Uploading PHP files to External Server (Web Hosting)

Uploading PHP files to External Server (Web Hosting)

A web hosting service is a type of Internet hosting service that allows individuals and organizations to make their website accessible via the World Wide Web. Web hosts are companies that provide space on a server owned or leased for use by clients, as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for other servers located in their data center, called colocation, also known as Housing in Latin America or France.

files can be uploaded via File Transfer Protocol (FTP) or a Web interface.

So now , we need  Hosting server for Our web site ,( which support PHP,MySQL,Apache) (some free web hosting plans are available )

http://www.freewebhostingarea.com/ - create one account for you



enter domain Name you want (here we given myphpsite.orgfree.com)


then give your Username and Password,

the following message you will get after registering

Welcome to FreeWebHostingArea.com!
Dear user, your account myphpsite.orgfree.com was successfully activated on orgfree.com server.
Your address is http://myphpsite.orgfree.com and you can visit/update your site right now.
Add an index page (examples: index.html or index.php) and put your files directly on root. No public_html folder required.
Be sure that your account has minimum 1hit per month. Inactive accounts are deleted at the end of month.
then you will get username, password,FTP username, FTP password

 Account Manager:
Username: myphpsite.orgfree.com

Password: ********



Your Personal FTP Information:
 FTP Server/Host:       orgfree.com
 FTP Login/Username:       myphpsite.orgfree.com
 FTP PassWord:       ********
your account created successfuly

then login to your account


Username: myphpsite.orgfree.com

Password: ********


the you will redirected to Control panel of your account (your site )


By clicking on file manager you can upload files

the you have to enter the FTP Login details


FTP Server/Host:       orgfree.com
 FTP Login/Username:       myphpsite.orgfree.com
 FTP PassWord:       ********


Uploading the File (PHP file to server )

here we are uploading the PHP file to the root folder (hello.php , given below) to server

=====================================
<html>
<body>
<?php
echo "Hello World";
echo "</br>";
echo "My First PHP page in  -http://www.freewebhostingarea.com/";
?>
</body>
</html>
====================================
after uploding the file you can view the page in the following link



====================================================================

using FTP Client program to Upload the File to external server 

here we are using  FileZilla, for uploding via FTP access 


FileZilla is a fast, reliable, and secure FTP/SFTP client that allows you to transfer files between Web sites and PCs running Windows. 

Download FileZilla http://filezilla-project.org/
 (downlod fileZilla Client )

After installing , open FileZilla application



Login with our FTP login details

FTP Server/Host:       orgfree.com
 FTP Login/Username:       myphpsite.orgfree.com
 FTP PassWord:       ********



now you can get a remote and local site view , you can easily upload files to remote server


now you have a file on desktop date.php, open fileZIlla and right click on the file (date.php) and clik upload

as shown in the fig

then view the file in browser - http://myphpsite.orgfree.com/date.php





Reference ;-

Thursday, April 26, 2012

PHP basics and Installation, Getting started

PHP basics


Dear friends,

here i am explaining the basics of PHP (Installation, Configuration, basic Syntax , Building a simple web site   etc) , i have gone through hundreds of tutorial in Net, and finally Decided to create one for Beginners who have the Basic knowledge of HTML , the Details given below is a mixture of my own and collected from net
if you find any error or any doubt please feel free to Contact me

What is PHP?

  • PHP stands for PHP: Hypertext Preprocessor
  • PHP is a server-side scripting language, like ASP
  • PHP scripts are executed on the server
  • PHP supports many databases (MySQL, Informix, Oracle, Sybase, Solid, PostgreSQL, Generic ODBC, etc.)
  • PHP is an open source software
  • PHP is free to download and use
PHP is an HTML-embedded scripting language. Much of its syntax is borrowed from C, Java and Perl with a couple of unique PHP-specific features thrown in. The goal of the language is to allow web developers to write dynamically generated pages quickly." 

This is generally a good definition of PHP. However, it does contain a lot of terms you may not be used to. Another way to think of PHP is a powerful, behind the scenes scripting language that your visitors won't see!
When someone visits your PHP webpage, your web server processes the PHP code. It then sees which parts it needs to show to visitors(content and pictures) and hides the other stuff(file operations, math calculations, etc.) then translates your PHP into HTML. After the translation into HTML, it sends the webpage to your visitor's web browser.


PHP was first created by Rasmus Lerdorf in 1995, and saw its first official release in 1997. Milestone releases included PHP 3 in 1998, PHP 4 in 2000, and PHP 5 in 2004. Today, many large-scale websites run on PHP. The author was first introduced to PHP in 2000, and have found the language to be pretty easy to work with.  Below is a simple "Hello World" program, PHP flavor:  <?php   print "Hello World."; ?>  Executing this program on a web server enabled with PHP produces the following output:  Hello World.


What is a PHP File?

  • PHP files can contain text, HTML tags and scripts
  • PHP files are returned to the browser as plain HTML 
  • PHP files have a file extension of ".php", ".php3", or ".phtml"

PHP Installation

Download PHP

                  Download PHP for free here: http://www.php.net/downloads.php

Download MySQL Database

                 Download MySQL for free here: http://www.mysql.com/downloads/

Download Apache Server

                Download Apache for free here: http://httpd.apache.org/download.cgi

You need to install all the Above separately and configure 

(AppServ is a full-featured of Apache, MySQL, PHP, phpMyAdmin. You can setup in 1 minute.
        Package of AppServ
             - Apache
             - PHP
             - MySQL
             - phpMyAdmin
)

(for this tutorial we have used widows 7 Operating system )

Installing  AppServ


1.then double click on the .exe file

2 .Give the Installation Directory - C:\AppServ (default)

3.Select the   Package of  AppServ
 
4.Give Server Name and email

5.Enter Root password  ( NB: Remember this password)


6.Installation Successful

and open Browser and type  http://localhost/phpinfo.php

if you are getting the following screen then your AppServe Installation is Successful



Writing your first PHP page

Basic PHP Syntax

A PHP script always starts with <?php and ends with ?>. A PHP script can be placed anywhere in the document.
On servers with shorthand-support, you can start a PHP script with <? and end with ?>.

where to put your PHP files in server

C:\AppServ\www is the default directory to put your php file

First php file , write the following code

<html>
<body>

<?php   echo "Hello World";  ?>

</body>
</html>


save this file as  hello.php ,put in side C:\AppServ\www\test   (test is our site )



then open this file in browser

 
so you are ready for doing PHP programming

Reference :-