Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Web languages(HTML, CSS, JS, jQuery, etc.)] Introduction To Php
#1
What is php? Php- (Php is a recursive acronym hypertext-processor) is a widely used open source general purpose scripting language that is especially suited for web development and can be embedded in HTML.

Introductory example:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 TRANSITIONAL//EN"
"http://www.w3.org/TR/htm14/loose.dtd">

<html>

<head>

<title>Example</title>

</head>
<body>

<?php

echo "hi,i'm a PHP script!";

?>

</body>
</html>

What distinguishes PHP from something like client-side Javascript is that code is executed on the server ,generating html which is sent to the client.The client would recieve the results of running that script,but would not know what the underlying code was .You can even configuire your web serer to process all of your HTML files with php,and there's really know way to tell what you have up your sleeves.


The best thing is that php is very simple to learn for a newcomer,this means in hours of reading code and learning you will be able to write your own script.
Reply
#2
Thanks for the post! Great introduction!

Best regards,
-Siberia
PacketPunks
Knowledge talks, wisdom listens.
PM me with any questions or comments
Reply
#3
(04-18-2014, 03:17 AM)Siberia Wrote: Thanks for the post! Great introduction!

Best regards,
-Siberia

You welcome I will make it way better still going to edit on it i'm abit tired so I decided to publish it early,going to sleep soon.
Reply
#4
Nice tutorial Smile

One thing I'd like to add though is a comment on your syntax. It is not essential but neat, best practice code will allow you to keep much better track of larger projects.

I'd suggest you create your templates using a syntax more like I've done in the spoiler below.
[spoiler]
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 TRANSITIONAL//EN"
"http://www.w3.org/TR/htm14/loose.dtd">

<html>

<head>
  
     <title>Example</title>

</head>

<body>

    <?php
        echo "hi,i'm a PHP script!";
    ?>

</body>

</html>
[/spoiler]


The indents are very helpful in keeping track of your many lines of code on larger pages.

Note: The only way to show indents on forums is using the code tags, otherwise the extra spaces will be taken away. The code tag also helps differ from your comments in the tutorial and the coding.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)