• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

PHP Paxton's Web Development School Part: 1

I really want to learn PHP. :rolleyes:

PHP:
<?php

$name = "Paxton";
echo $name;

?>

PHP:
<?php

//Config
$pwn = 5;
echo $pwn;

//Content
if ($pwn == 7)
{
echo "<br>";
echo "It doesn't work!";
}
else if($pwn != 7)
{
echo "<br>";
echo "I learned something.";
}

?>

PHP is not everything, in web development you need to know few languages, if you don't know basic HTML/XHTML there is no point of learning PHP also CSS would be usefull.
 
I really want to learn PHP. :rolleyes:

PHP:
<?php

$name = "Paxton";
echo $name;

?>

PHP:
<?php

//Config
$pwn = 5;
echo $pwn;

//Content
if ($pwn == 7)
{
echo "<br>";
echo "It doesn't work!";
}
else if($pwn != 7)
{
echo "<br>";
echo "I learned something.";
}

?>

Why no just:
Code:
if ($pwn == 7)
{
it doesn't... }
[B]else[/B]
{
i learned...
}
 
Why no just:
Code:
if ($pwn == 7)
{
it doesn't... }
[B]else[/B]
{
i learned...
}

Same outcome isn't it :<?

I know is shorter by your way, but I'm learning... :)

PHP is not everything, in web development you need to know few languages, if you don't know basic HTML/XHTML there is no point of learning PHP also CSS would be usefull.

I know HTML. ;)
 
After reading this begginer tutorial I was able to fix the errors in a advanced php script that no1 knew how to help me. Amazing! Thanks Paxton!
 
After reading this begginer tutorial I was able to fix the errors in a advanced php script that no1 knew how to help me. Amazing! Thanks Paxton!

Yea, must have been uber advanced... :rolleyes:
 
Object not found!

The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.

If you think this is a server error, please contact the webmaster.
Error 404
localhost
10/21/09 17:59:34
Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i PHP/5.2.9

Well gonna reinstall my xampp :D
 
I guess it's a good tutorial, but really, you basically just write PHP snippets. PHP is not the first step.
Explain domain names, hosting, more simple languages like html.
 
Code:
<?php
$hisname = 'paxton';
echo $hisname;
?>



Code:
<?php 
$a = 4;
$b = 7;
$sum = $a+$b;

if ($sum == 10) 
{
echo "i didnt learn";
}
else if ($sum == 9)
{
echo "I think i learned";
}
else
{
echo "Noob.";
}
?>
 
PHP:
<?php
//CONFIG
$x = 1;
$y = A;
if ($x == '1' && $y == 'A')
{
echo "I guess this tutorial did help:)";
}
else
{
echo "Is this shit busted?";
}
?>
 
Last edited:
fixed :D

Second:
PHP:
<?php
/*The very big
&useless config,
and strings*/
$name = 'SyntheticX';
$a = 'learned';
$b = 'a lot';
$c = 'helpful';
$d = 'nothing';
$e = 'very';
$f = 'Bye';
$g = '!';
$h = 'true';
$i = 'false';
//Start Code plx
if ($l == $t)
{
echo "$name '$a' '$b' '$g'";
}
else if ($l == $f)
{
echo "$name '$a' '$d' '$f' '$g'";
}
//code ends here
?>
Fixed? I think :p
 
Last edited:
1) Variable names may not start with numeric characters. Alphabetical and underscores are the only allowed first character.
2) When defining a variable, you should always end it with a semi-colon.
3) Any string values must always be surrounded by either single or double quotation marks. Otherwise caught as a constant.
4) Putting the and-symbol (&) in front of a variable means that you are passing by the reference (e.g. when trying to modify a value through functions). http://uk.php.net/manual/en/language.references.pass.php

Other then that, good job!
 
Yeah, using the an percent(&) was a typo, but I think I fixed the rest? And thanks^_^
 
You missed point 3.
PHP:
$var = 'value';
not
PHP:
$var = value;
:- )
 
Back
Top