Php
Hello all,
I don't know if this is in the right spot - but I will try it anyway.
What is php?
Why is it used?
When is it used?
Is it harder to make than html?
I don't know anything about php - so I am just learning and thought I would start here.
TIA
Brooke
Mark Hensler posted this at 17:51 — 15th March 2002.
He has: 4,048 posts
Joined: Aug 2000
Official site: http://www.php.net
PHP means 'PHP Hypertext Processor'
(a recursive acronym, like GNU = GNU's Not Unix)
PHP is a server-side scripting language. And from the FAQ on the site: "The goal of the language is to allow web developers to write dynamically generated pages quickly."
It is harder to write PHP scripts than HTML pages because PHP is a scripting language, whereas HTML is a markup language. The difference is that markup languages lack logic, they simply format. (ex: try adding numbers with HTML, let alone connecting to a database)
I was very general. Do you have questions on something specific?
Mark Hensler
If there is no answer on Google, then there is no question.
Brooke posted this at 18:46 — 15th March 2002.
She has: 681 posts
Joined: Feb 1999
So PHP is something that you would use with a database to search it. (amongst many other things) Is that right?
For a database - would you create an html form with form fields to search - or would you create a php form with form fields?
Brooke
Busy posted this at 20:33 — 15th March 2002.
He has: 6,151 posts
Joined: May 2001
hopefully without confusing you.
PHP has heaps of built in "things", example on forms when you name the form options, they become varibales for PHP
...
enter your name
...
so "your_name" becomes $your_name in PHP (variables etc have to start with dollar sign). so with PHP I could now put
<?php
echo "Hello $your_name"
?>
<?php
and
?>
echo prints to screen, same as printf etc
$your_name is the vaule of what was given in the form.
This is of course without database example
If you have no programing experience it could get a lil tricky in the advanced stuff but at least the basics of PHP is pretty easy
good luck
mairving posted this at 20:39 — 15th March 2002.
They have: 2,256 posts
Joined: Feb 2001
Funny but initially PHP stood for Personal Home Page.
PHP parses PHP code into HTML, so you would build your form in PHP and it would parse it to HTML. Quite simply a little bit of PHP code like:
<?php
echo \"<HTML>\n\";
echo \"<HEAD>\n\";
echo \"<TITLE>\n\";
echo \"Brooke's Page\";
echo \"</TITLE>\n\";
echo \"</HEAD>\n\";
echo \"<BODY>\n\";
echo \"Page Contents\";
echo \"</BODY>\n\";
echo \"</HTML>\n\";
?>
Would actually build an entire (but simple) HTML page.
Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states
Suzanne posted this at 21:10 — 15th March 2002.
She has: 5,507 posts
Joined: Feb 2000
moving this up to webmaster's corner, where she belongs.
php is nice in that you can have the scripting on the "page", unlike perl which requires some more complex templating.
Mark Hensler posted this at 21:40 — 15th March 2002.
He has: 4,048 posts
Joined: Aug 2000
I've heard that too, but have never found documentation of it. So, I just tell people of the recursive acronym (as that's what's currently in the FAQ on the site).
Mark Hensler
If there is no answer on Google, then there is no question.
mairving posted this at 21:46 — 15th March 2002.
They have: 2,256 posts
Joined: Feb 2001
Here is a little bit about the history.
mjames posted this at 23:12 — 15th March 2002.
They have: 2,064 posts
Joined: Dec 1999
Two of my favorite PHP things are there is no CHMODing or anything of the like with PHP and also, code written in PHP is protected so someone can't just view the source and copy it. It shows what the server reads - which I'm sure is also true for other server-side languages, but still nice.
I hope I'm accurate on those - I'm not PHP guru, but I've toyed with it, mostly with my vB.
OB_redemption posted this at 02:51 — 16th March 2002.
They have: 11 posts
Joined: Mar 2002
here's an article for you to read
there's a also very active PHP forum at SitePoint Forums here... i'm there often too ... go there and ask any questions and you're bound to get a quick reply ... honestly, i learnt alot just reading the posts...
OpenBook - a PHP/MySQL guestbook
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.