[HELP] Learning PHP -
Vipero - 19.07.2011
I've decided to try and learn PHP once again, as my brain just switches off, I get distracted by other things (you already know what), I wish to learn, as I would like to design my site, or aid a PHP coder in creating it with me. Does anyone recommend a certain method of learning it?
Re: [HELP] Learning PHP -
Runedog48 - 19.07.2011
I hate php, but I learn as I go. A good website to learn through is:
http://www.w3schools.com/default.asp
Then what I sometimes do is go through to an example and erase the code and put my own. But it doesn't work for php as it requires a re-direct to the php page for it to work..
Re: [HELP] Learning PHP -
Vipero - 19.07.2011
Quote:
Originally Posted by Runedog48
I hate php, but I learn as I go. A good website to learn through is:
http://www.w3schools.com/default.asp
Then what I sometimes do is go through to an example and erase the code and put my own. But it doesn't work for php as it requires a re-direct to the php page for it to work..
|
Yeah. I used w3 to learn HTML (basic coding I know but hey, it looks ok on your CV!). Thanks for the reply anyway.
Re: [HELP] Learning PHP -
Steven82 - 19.07.2011
I've recently been trying to learn PHP as well, so far it's turning out great. You just have to stay focused, follow the tutorials and you'll be fine.
Re: [HELP] Learning PHP -
Vipero - 19.07.2011
Quote:
Originally Posted by Steven82
I've recently been trying to learn PHP as well, so far it's turning out great. You just have to stay focused, follow the tutorials and you'll be fine.
|
Thanks. I'm trying my best. This is like the 3rd/5th time trying to learn PHP, I'm learning it to build my first PHP site, edit my friends forum (TinyBB) and make myself a control panel for my Linux VPS.
Re: [HELP] Learning PHP -
Vipero - 19.07.2011
How can I view my PHP file without uploading it to a site?
Re: [HELP] Learning PHP -
Vipero - 19.07.2011
Quote:
Originally Posted by FC-RP
How can I view my PHP file without uploading it to a site?
|
Scratch that. Figured it out. If you look at "http://domigraph.netne.net/" (my PHP project site). The tutorial asks you to input a variable
I do not understand variables. Can anyone help?
Re: [HELP] Learning PHP -
saiberfun - 19.07.2011
Quote:
Originally Posted by FC-RP
How can I view my PHP file without uploading it to a site?
|
just install xampp and start it's apache service at first
if you want to use mysql later you can start the mysql service too
then you can access that through you localhost
so you just put in your url localhost and it redirects you the the xampp example page on your pc
in htdocs(in your xamppfolder[in C:\]) you can delete all the sample files or move them in an own folder and
then you can put your php stuff there
To the vriable problem:
You are Probably putting it out this way
echo 'Hello! This is a test script! $var_name=value;';
but it should be
echo 'Hello! This is a test script!'.$var_name=value;
if not just show us the piece of code^^
Re: [HELP] Learning PHP -
ћNJ - 19.07.2011
PHP is not that hard, PM me I can help you with anything you need.
I would call it easier than pawn.
Re: [HELP] Learning PHP -
ћNJ - 19.07.2011
Yes.
1) You can't assign value to var outside of php tags (<?php ?>).
2) It would be $var_name="value"; if string.
Re: [HELP] Learning PHP -
Vipero - 19.07.2011
Quote:
Originally Posted by ћNJ
Yes.
1) You can't assign value to var outside of php tags (<?php ?>).
2) It would be $var_name="value"; if string.
|
AH! I see now, thanks for the help.
Could you explain variables a bit more to me please?
Re: [HELP] Learning PHP - [L3th4l] - 19.07.2011
Quote:
Originally Posted by FC-RP
AH! I see now, thanks for the help.
Could you explain variables a bit more to me please?
|
You are better off searching for tutorials on ******.
Go to this site for a tut on variables:
http://www.tizag.com/phpT/variable.php
That same site provides more PHP tutorials and It's a great website to start learning from!
Re: [HELP] Learning PHP -
Vipero - 19.07.2011
Quote:
Originally Posted by [L3th4l]
You are better off searching for tutorials on ******.
Go to this site for a tut on variables: http://www.tizag.com/phpT/variable.php
That same site provides more PHP tutorials and It's a great website to start learning from!
|
Thanks.
Re: [HELP] Learning PHP -
gamer931215 - 19.07.2011
$x=200 you forgot a ; here
and what is $var_name=value; ?
value is not declared ?
Edit: oh, didnt notice the other comments, silly me ^^
Re: [HELP] Learning PHP -
Norn - 19.07.2011
There are plenty of tutorials available by doing a simple search, people here aren't going to spoonfeed you php..
Re: [HELP] Learning PHP -
Westie - 19.07.2011
Here is a simple bit of PHP for you to ponder over.
PHP код:
trait Block
{
public
$hello = null,
$sMessage = "well hello there";
public function test()
{
echo "well done, it works";
}
}
class Something
{
use
Block;
public function __construct()
{
$this->hello = function()
{
return array($this->sMessage);
};
}
}
$p = new Something();
echo $p->hello()[0];
Re: [HELP] Learning PHP -
iLinx - 19.07.2011
Quote:
Originally Posted by Westie
Here is a simple bit of PHP for you to ponder over.
|
I'm glad to see someone else excited over the array dereferencing and trait support in PHP 5.4, too bad they just started the alpha for it.
Re: [HELP] Learning PHP -
Saurik - 19.07.2011
I am by far not an expert in PHP but what helped me begin is watching and reviewing some tutorials and also editing some codes.
Hope it helps.
Re: [HELP] Learning PHP -
Kwarde - 19.07.2011
Here is a small script with some variables etc.
PHP код:
<?php
$title = "PHP Test";
$showPage = isset($_GET['showpage']) ? true : false;
$pageLine1 = "Welcome to this site!";
$pageLine2 = "This is just some text. Let's call this famous text: \"Hello world!\"";
?>
<html>
<head>
<title><?php echo $title; ?></title>
</head>
<body>
<?php
if($showPage):
echo $pageLine1 . '<br />' . $pageLine2;
else: echo "The page won't be showed :P";
endif;
?>
</body>
</html>
Demo:
http://rl-rp.com/test.php
First try that link, then:
http://rl-rp.com/test.php?showpage
As you have noticed maybe, I used:
statement
:
//operation
endif;
instead of
statement
{
// operation
}
I prefer that
Re: [HELP] Learning PHP -
Pghpunkid - 19.07.2011
Quote:
Originally Posted by FC-RP
Yeah. I used w3 to learn HTML (basic coding I know but hey, it looks ok on your CV!). Thanks for the reply anyway. 
|
I did that with PHP, C++, VB Legacy, and VB .NET. It really surprised them that i took the time to learn it on my own.
I started PHP with GD, the graphics library. I do not recommend it! I do recommend tinkering! just start playing with things. Its not very difficult for basics.