Shop OBEX P1 Docs P2 Docs Learn Events
PHP differ from javascript — Parallax Forums

PHP differ from javascript

merkutinaamerkutinaa Posts: 1
edited 2014-03-13 05:38 in General Discussion
How does PHP differ from javascript? I'm confused about what the purpose of php's existence is. My understanding is that it does the same as javascript, but server-side. Does that make sense, or am I totally off?

Comments

  • BlackSoldierBBlackSoldierB Posts: 45
    edited 2014-03-13 05:18
    PHP does indeed run on the server, so every time you want to change something youmust do a post-back (i.e sending data back to the server).
    They can do more or less the same thing, like hiding input field.
    But they can also do total different things, in javascript for example you can monitor the users keystrokes and mouse clicks.

    While PHP is invisible to the user (except for the .php extension), Your javascript code can be seen by everyone (and thus copied).

    With PHP you can dynamicly change the page before it is send to the browser, you can load some records from a database. A good example is a forum (like this :tongue:).

    BTW: How did you get to this forum? :smile:
  • PublisonPublison Posts: 12,366
    edited 2014-03-13 05:38
    Moved to General.
Sign In or Register to comment.