Results 1 to 5 of 5

difference between the javascript and php

This is a discussion on difference between the javascript and php within the Programming forums, part of the Web Designing & Development category; JavaScript Programming Language This is the only language of the three which executes within the web page loaded in the ...

  1. #1
    Senior Member Array akash's Avatar
    Join Date
    Oct 2008
    Location
    Heaven (Earth)
    Posts
    500

    Default difference between the javascript and php

    JavaScript Programming Language

    This is the only language of the three which executes within the web page loaded in the browser window. It is uniquely suited for on-page calculations, form error checking, and other virtually instant interaction with the user.
    It can import files of information that are also otherwise available by typing the file's URL into a browser's address bar. (External JavaScript files, image files, etc.)
    However, it can not, on its own, store information to a file or update databases. To do so requires the cooperation of other software running on the server where the file/database is located. The "other software" can be any CGI software, including PHP or Perl, that can manipulate data in files on the server.
    JavaScript code is part of the web page source code. Additional JavaScript code can be imported into the web page from external files.
    PHP Programming Language

    PHP source code is part of the web page source code file. Yet, it is not part of the source code sent to the browser.
    This is how it works:

    1. A browser requests a PHP web page.
    2. The server grabs a copy of the file and:

      1. Runs any PHP code it finds on the page.
      2. Modifies the page if the PHP code says to do so.
      3. Strips out the PHP code.
      4. Sends the resulting web page to the browser.

    3. The web page loads into the browser. If you "view source," the PHP code is not there.

    PHP can be used to generate web pages on the fly, read and manipulate databases, import files on the server with or without additional PHP code, and obtain files of information from other domains (if that information is also available by typing the file's URL into a browser's address bar.)
    PHP is executed through the HTTP protocol. Think browsers. Also, other software can execute PHP with the software's URL — page grabbers and scheduling software, as examples.
    For those who prefer the source code of the software be an integral part of the web page file it affects, PHP is a preferred language.
    Some people find PHP easier to install because the files are uploaded into the same directories as regular web pages. Also, the files do not themselves need special permissions. The same permissions as regular web pages will do just fine.

  2. #2
    Junior Member Array
    Join Date
    Dec 2008
    Posts
    7

    Default Re: difference between the javascript and php

    To contradict what has been said , the difference is that JavaScript can be written on the server side too and can get very complicated. JavaScript is often used as the client scripting language on the same page with PHP which does the server side stuff. ASP or ASP.net is an alternative to PHP.

  3. #3
    Senior Member Array akash's Avatar
    Join Date
    Oct 2008
    Location
    Heaven (Earth)
    Posts
    500

    Default Re: difference between the javascript and php

    Quote Originally Posted by 3agmy View Post
    To contradict what has been said , the difference is that JavaScript can be written on the server side too and can get very complicated. JavaScript is often used as the client scripting language on the same page with PHP which does the server side stuff. ASP or ASP.net is an alternative to PHP.
    excellent this is also important difference

  4. #4
    Senior Member Array msn90's Avatar
    Join Date
    May 2009
    Location
    india
    Posts
    146

    Default Re: difference between the javascript and php

    PHP is a server side programming language, which is ran into the web server when a page is generated, before being sent to the browser.

    Javascript is a client side scripting language, that run into the browser, and is allowed to interact with the element that are present into the page.

    PHP run only during the page load. Once the page is loaded, no more PHP can be run.

    Javascript starts only when the page is received.

  5. #5
    Senior Member Array
    Join Date
    Mar 2011
    Posts
    110

    Default Re: difference between the javascript and php

    The basic difference is thst JavaScript is the primary language for execution by the client side, i.e. the browser where as PHP that is Hypertext Processor, is typically implemented on the server side.





Similar Threads

  1. Replies: 163
    Last Post: 04-08-2012, 11:25 PM
  2. Replies: 67
    Last Post: 12-09-2011, 04:11 PM
  3. Replies: 8
    Last Post: 03-24-2011, 11:07 AM
  4. Difference between one way & directory link
    By esnc in forum Search Engine Optimization
    Replies: 4
    Last Post: 02-13-2009, 08:53 AM
  5. Difference between SEO and PPC
    By indieswal in forum Search Engine Optimization
    Replies: 10
    Last Post: 12-18-2008, 11:36 AM

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
  •  
SEO Forum | Web Hosting Forum | Websites For Sale |