Re: newbie question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Sep 15, 2015, at 5:40 PM, Haluk Karamete wrote:

could you explain a little bit more on the "which part of the code read the
files with extension .php"?


On Tue, Sep 15, 2015 at 5:37 PM, Andrei Bernardo Simoni <
andrei_simoni@xxxxxxxxxxx> wrote:

HelloIm new in the PHP project and i would like to know where I can
start.To quench my curiosity I wonder which part of the code read the files
with extension .php
Thanks so much everyone

files with the extension .php are read by a web server such as Apache, which
has a php extension that process the php code in the .php file.

Php code IS NOT run by the client/browser software. The html or combination of html and javascript communicate with the server to process such things as form input. This confuses people often who are new to php because the code
is written directly into the html file.

In a file with php code and a .php extension can process get queries

for instance it is possible to have an anchor tag in a web page with the
following value for the href attribute

<a href="somePhpCode.php?x=doSomething&y=showmewhatyoudid">contact the server</a>

When this php code page is loaded from the server, the server code can be written to look
for a $_GET variabls 'x' and 'y'
<?php
if($_GET['x'] && $_GET['y']) /* " if you see both (&& means and) of these $_GET variables run the code in the braces */
  {
// this is a comment. it is not processed: It only runs to the end of the line
  /*
this is also a comment. It can extend over multiple lines or be very short and used
  in the flow of the code to add information about the code.
*/
// Here you would expect $_GET['x'] = 'doSomething'; and $_GET['y'] = "showmewhatyoudid";
 }
It then can produce some html markup and content that represents how the server was coded
to process that input.


On the console, php can be written and run directly from the console or
from php code files, again with the extension .php.

There are texts available from publishers for beginning to advance coding in php There are also many tutorials on line, as well as forums and mailing lists, such as
this.

If you are new to coding, you should get a good grounding on what exactly coding
does and is used for.

If you have done programming in other languages, it should only be the syntax and
features that you will need to become familiar with.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux