Charas-Project

Off-Topic => Really Old Stuff => Archive => PHP => Topic started by: X-F3R on July 14, 2003, 06:29:09 AM

Title: What exactly is Php?
Post by: X-F3R on July 14, 2003, 06:29:09 AM
well, it's been a while since i've started a topic, but anyways, you know what is is already...

what exactly is PhP? i mean, my bro said that it's an advanced form of HTML... so wassup with that?

i know, i know, look for a site which briefly explains what PhP is, but.. i hate reading paragraphs and paragraphs of crap (no offence) but can anyone here give me a  simplified explaination of what PhP is? cuz i wanna take my web designing skills to another level... so help pls ppl

thanks
X-F3R

[don't anyone run your mouth here, you're just making a fool of yourself. especially the words which are less offending, like suck and stupid, which are used so oftenly, that people who use them think that they're superior. i really get annoyed seeing people do this to people who don't know some stuff that they know... thanks again -X-F3R]
Title:
Post by: X-F3R on July 14, 2003, 06:36:30 AM
oh yeah, and one more thing... does anyone know a free hosting which supports PhP? thanks
Title:
Post by: cosmo on July 14, 2003, 09:04:59 AM
if you want info on php check out http://www.php.net/
Title:
Post by: Alex on July 14, 2003, 09:59:00 AM
In the words of php.net:
Quote

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

At the end, it's a server side language, with it you can generate html, and not only.
A fast example, to understand:
Variables in php are leaded by $, so $name is a variable.
If you do:

$name="X-F3R";
print "";
print "

WELCOME, $name!!!!

";
print "";

your server will serve an html page with this source:


WELCOME, X-F3R!!!!




Ok, this is really TOO simple, but it may gives the idea ;)

Title:
Post by: X-F3R on July 14, 2003, 02:15:31 PM
lol... it gave me an idea... but that's basically like HTML... is there any 'a tad bit more advanced' code? hehehe i wanna see what this baby can do... hehehehe
Title:
Post by: Alex on July 14, 2003, 03:46:09 PM
Ok, another simple example, just to understand.
Arrays time!
Imagine you want to create a select with 5 options.
Something like:



In php, you can do:

$option_array=array('one','two','three','four','five');
print "";

Need a comment, or may you understand this?
Well, and imagine that that array may also be a database result, something as all the names of Charas users.
This sounds as a little "php, how to understand". LOL!
Title:
Post by: GaryCXJk on July 14, 2003, 09:31:08 PM
Or you could use Alex's example, and create a file named like, nametitle.php

 ";
print "WELCOME $name!!!!";
print "";
print "

WELCOME, $name!!!!

";
print "";?>

Then, in a browser, you can call (I assume you have a webserver installed on your computer):

http://127.0.0.1/nametitle.php?name=X-F3R

You will see a title that says "WELCOME X-F3R!!!!" and... uh... a title on the screen itself.

Another example:



Testpage


print "Name: $name
";
print "What website rocks? ".$site."
";
?>
This is the end of the page.




Lets call this file test.php, so you can call it like this:

http://127.0.0.1/test.php?name=X-F3R&site=CHARAS

The browser will interpretate this as:



Testpage


Name: X-F3R

What website rocks? CHARAS

This is the end of the page.



You can see that you can use PHP and HTML next to each other.

Title:
Post by: Alex on July 14, 2003, 09:37:21 PM
Yeah!
I think we should open a beginner's school, Gary.
We're TOOOO good techers :D :D :D
Title:
Post by: X-F3R on July 16, 2003, 02:49:11 PM
I think you should...lol! well... i havent installed a PhP server on THIS computer... cuz it's really slow and stuff... so yeah... i'm going to in my OTHER pc, when it's got it's connection... lol... my house is pretty messed up...so yeah... hehehehe

thanks guys for the examples!
X-F3R