Results 1 to 9 of 9

Thread: Want to Learn PHP

  1. #1
    Join Date
    Aug 2008
    Posts
    31

    Want to Learn PHP

    Hello friends

    I want to learn PHP. Can someone provide me Information about PHP and Institute name from where i can learn.

  2. #2
    Join Date
    Aug 2008
    Posts
    30
    PHP is a computer scripting language. Originally designed for producing dynamic web pages, it has evolved to include a command line interface capability and can be used in standalone graphical applications. While PHP was originally created by Rasmus Lerdorf in 1995, the main implementation of PHP is now produced by The PHP Group and serves as the de facto standard for PHP as there is no formal specification.

    PHP is a powerful server-side scripting language for creating dynamic and interactive websites.

    PHP is the widely-used, free, and efficient alternative to competitors such as Microsoft's ASP. PHP is perfectly suited for Web development and can be embedded directly into the HTML code.

    The PHP syntax is very similar to Perl and C. PHP is often used together with Apache (web server) on various operating systems. It also supports ISAPI and can be used with Microsoft's IIS on Windows.

  3. #3
    Join Date
    Aug 2008
    Posts
    68

    Information on PHP

    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 (OSS)
    • PHP is free to download and use


    PHP Files

    • PHP files may 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"



    Advantages of PHP

    • PHP runs on different platforms (Windows, Linux, Unix, etc.)
    • PHP is compatible with almost all servers used today (Apache, IIS, etc.)
    • PHP is FREE to download from the official PHP resource: www.php.net
    • PHP is easy to learn and runs efficiently on the server side

  4. #4
    Join Date
    Jul 2008
    Posts
    99

    How do I write to a file using PHP

    There is a basic pattern to writing to a file, it goes something like this:

    • Open the file using fopen
    • Lock the file using flock
    • Write to the file using fputs or fwrite
    • Unlock the file using flock
    • Close the file using fclose


    This is the order that the operations (usually) need to be carried out in. The following example shows you how to create a file, then write a string to the file.

    Jargon

    Handle - The name often given to the variable defined when using the fopen function.
    Mode - A letter that represents how the file should be opened when using fopen.

    <?php

    $fp = fopen('filename.txt', 'w'); // set the handle to the variable $fp
    // and open the file in "w" mode.

    $string = 'Test String'; // set the $string variable

    flock($fp, LOCK_EX); // lock the file "exclusivley" for writing

    fputs($fp, $string); // write the data to the file

    flock($fp, LOCK_UN); // unlock the file

    fclose($fp); // always call fclose to close the file.
    // forgetting to close or lock files is the main cause of
    // files getting corrupted.

    ?>
    1. Now, to go over the example, the first line, where the fopen function is used, opens the file in writeable mode... If the file does not exist it will attempt to create it. The important thing to remember about using the "w" mode in fopen is that any data in the file will be truncated (emptied). There are other file handling modes, which can be looked up on the php website: <http://www.php.net/fopen>. Some of these other modes will also be covered later in this post.
    2. On the next line, we just simply set the variable $string to the value 'Test String'. This is the data that will get written into the file later on.
    3. Next we lock the file using flock. Using an exclusive lock, which is set by putting LOCK_EX, the file is locked from other scripts writing to the file or reading from it while we put the new information into the file. If the file isn't locked and two scripts try to write to it at the same time, it can get corrupted.
    4. The next part is the part that actually writes the information to the file. Using the fputs function it use the file path and data supplied ($fp and $string in this case), and writes $string to $fp.
    5. From here, the file needs to be unlocked using flock again, otherwise no other scripts would be able to write or read it. To unlock the file, we use LOCK_UN.
    6. Finally, we have finished with the file so we can close it. Using the fclose function we pass it the file handle ($fp) and it closes it. You should always do this as this is another thing that can lead to files getting corrupted.

  5. #5
    Join Date
    May 2008
    Posts
    42

  6. #6
    Join Date
    Jun 2008
    Posts
    96
    Please have a look at this thread
    PHP code needed
    I hope this helps you!

  7. #7
    tyuivbn Guest
    If you have any question, you can get answer at www.phpbuilder.com, which has a popular php developer forum

  8. #8
    Kyle2008 Guest

    Want to Learn PHP

    originally stood for Personal Home Page.[8] It began in 1994 as a set of Common Gateway Interface binaries written in the C programming language by the Danish/Greenlandic programmer Rasmus Lerdorf. Lerdorf initially created these Personal Home Page Tools to replace a small set of Perl scripts he had been using to maintain his personal homepage.

  9. #9
    Join Date
    Jun 2008
    Posts
    96
    Thanks a lot for the site tyuivbn!

Similar Threads

  1. Want to learn French
    By kohali in forum Education Career and Job Discussions
    Replies: 3
    Last Post: 16-03-2009, 01:45 PM
  2. Want to learn ASP.Net
    By Makrand in forum Education Career and Job Discussions
    Replies: 5
    Last Post: 29-11-2008, 05:05 PM
  3. learn to program
    By bigboy in forum Software Development
    Replies: 1
    Last Post: 03-10-2008, 05:34 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,457,381.88416 seconds with 17 queries