Jump to content
xisto Community
whitespirit

What Is Php? what is php?

Recommended Posts

PHP is a server-side HTML embedded scripting language.

PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML.


Share this post


Link to post
Share on other sites

and as many possible way to be used if you know who look at ipb forum nothing but php scripting and some minor html.

Share this post


Link to post
Share on other sites

PHP is another and more advanced way of writing a web pages. All pages must end with the file extension .php just like when you write html, all pages must end with .htm / .html .

 

There are lots of other languages which do roughly the same things as php, such as JSP, ASP and PERL. Xisto has all of these languages except ASP. The great thing about these languages is that they are server-sided which means that they run at the server so, unlike javascript, the user doesn't have to download any extra files to look at your php webpages.

 

You may have seen urls in many webpages such as this ( http://forums.xisto.com/no_longer_exists/?id=1 ) Our good friend php helps us to construct these types of pages. HTML cannot do this:

 

<?

 

if ($_REQUEST["id"] == "1") {

 

echo "Hello";

 

}

 

?>

 

 

Lets start with the basics. All PHP code must have <? ?> (shown in red) round it just like all html coding but have <html> </html> round it. This tells php that there is gonna be some php code coming.

 

Now the part in blue and black basically says to php that if in the url id=1 can be found it must perform the following action. The very important parts you must notice are the brackets the two equal signs and the {. This may seem very compucated to someone who has not done php before (I know this) but I promise you you will get the hang of it.

 

But, there's still more to come! The part in green tells us what php must do if id=1 is found in the url. This says echo "Hello";. Echo tells php it must write something. What it must write can be found in the speech marks. Notice ; is one the end. This is mandatory and echo will not work without this.

 

Now we have the }. This tells php to stop performing the action if id=1 can be found in the url. Next is the red ?> and this tells php that there's no more php code till <? is found again, if it is found again.

 

If you wish to learn more about php. Here are some good resources:

 

http://www.w3schools.com/php/default.asp

http://php.net/

 

Hope you understood it :unsure:

 

cmatcmextra

Share this post


Link to post
Share on other sites

Well actually I have something to say to that. I am a noob at php but I know that it would example.com/file.php?view=id=1 or something like that. And also. I don't know if it would work with <? I learned it that you have to write it <?php and end it with ?>

Share this post


Link to post
Share on other sites

Well actually I have something to say to that. I am a noob at php but I know that it would example.com/file.php?view=id=1 or something like that. And also. I don't know if it would work with <?  I learned it that you have to write it <?php and end it with ?>

159091[/snapback]


Both <? <?php are acceptable ways of starting php. I don't know why but most people tend to start php like this { <?php } but I tend to start it the other way because it's faster to type. Your script will work using both of these methods.

 

Butphp must always end with ?> never php?>

Share this post


Link to post
Share on other sites

PHP is a wonderful and fast and easy to learn programming language.. and it's free... many website uses it so it's popular... and when they know that you use PHP, it means you are a powerful programmer... :D

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.