Dynadot โ€” .com Registration $8.99

How Php works

Spaceship Spaceship
Watch

Nicholai

Established Member
Impact
0
hi
You could say im a site-noob. i create my sites with frontpage and dreamwaver and use html. I ve heard a lot about php. it should be great, only the people doesnt want to sit down and explain to me how it works. could somebody tell something to me? must i learn a lot of new codes, must i retyp all my sites if i want to change them to php?

Just tell me the advantage php and a little bit of how it works
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
you had 4 questions in that post. 1 and 2 are the last two questions in ur big paragraph.

1) You will have to learn new codes, but there is not too much of it. Once you get the general syntax, the functions that exist are logical. The syntax is very simple.

<?php
functionname(parameters,moreparameters);
//This is a comment, dont forget about semicolons
$variable="variable text" . $textfromothervariableaddedon;
?>

Lotsa tutorials out there on syntax and basic stuff.

2) There is no need to retye your existing sites; the html will work perfectly. The only change you need for the php scripts to work is change the file from a .html to a .php. just like you have open and close tags (example: <html></html>) the open and close tags for php are <? and ?>. The code can go anywhere on the page.

3) The advantage to php is to make the page dynamic and much easier to update. you can also make it interactive by having a member log in, etc. if you use php, and your front page is, for example, about the news in Pefkakia, it wud be easy. since news is added every day, you can use a php script that makes a new page (with forms) where you can just type in what you want, the php will take the text and automatically insert it into the website. also, you can use it to get times and password protect stuff etc. when you get REALLY advanced, you can even make games with it.

4) How it works: i hope ur familiar with the terms client and server. if not,
Client = person going to the website
Server = server that the website is hosted on

Client requests the website from the server. the server checks to see if there is any php script to execute. since php is a server script, it will execute anything that is in the php tags. because of this, it is impossible for the client to see what you have in ur php script (unless they are |-|4><><0R5 [hackers]). the server runs the script and outputs the proper html content which is then sent back to the client. its pretty handy

i would suggest www.w3schools.com to begin learning, thats where i started.

i hope this helped, please give me reputation points ;)
 
1
•••
Also, relating to learning new codes, once you learn the standard syntax and find a format which you are comfortable with using, PHP is as easy as posting here on NP. In fact, it's as easy as going to www.php.net to find any function you need (they are ALL documented) ;)

nasaboy007 said:
when you get REALLY advanced, you can even make games with it.
Whoooooa slow down there! :o! You can make a Backend (script that handles server-side stuff) to a game using PHP, but making a game 95% of the time requires Javascript and/or Macromedia Flash (both of which are different from PHP), unless you are making a text based game. Just don't want to lead you in the wrong direction :).


nasaboy007 said:
Server = server that the website is hosted on
To clear this up a little, using a definition from Google: "Server: A computer that delivers information and software to other computers linked by a network." Basically, a server is the computer that delivers the content to you by transmitting the website over the internet. :)

PHP is a very easy language, supported by almost all linux and some Windows web hosts, and can do much more than standard HTML. I would recommend getting into it.
 
Last edited:
0
•••
lol nice tips i am learning php too well i know a lot of it kinda and w3schools is the best place to get tut and stiff on almost ne thing related to making a website
 
0
•••
W3 schools does not teach you PHP... www.php.net is the best place... but get a book ;)
 
0
•••
thx to anybody, i hope i can have my own advanced php site soon :bingo:
 
0
•••
The php tags are actually;

<?php
?>
 
0
•••
and most servers support short tags aswell

<?
echo "hello";
?>
 
0
•••
Yes but its good practice to use <?php and ?>, not all browsers understand <? ?>......not to mention it will annoy all good developers these days as its the standard to use <?php these days :P
 
0
•••
liam_d said:
not all browsers understand <? ?>

Browsers don't *need* to understand since all they'll download is the HTML output by it ;)

Anyways, dude, if you want to start PHP, make sure you realize well that PHP is just a computer language. It is logical, it does what you say it does, and if it does it wrong, you''ve told it wrong. Be secure and systematic in your coding, with attention. That'll certainly speed up your coding, because you don't have to debug parse errors and stuff.
 
0
•••
i found that if ur good at doing proofs in high school mathematics, ull be a good programmer cuz u need the same step by step mind frame. sry for the errors lol
 
0
•••
i hate proofs :D
 
0
•••
Carbine18 said:
i hate proofs :D

Well wasn't that a completely pointless post eh?

Try looking up some basic tutorials on php, they always help.
 
0
•••
thanks, do you mind if i use these, php has always facinated me! thanks alot! i hope you get what you're looking for Nicholai!
 
0
•••
if we didnt want anyone other than nicholai to see our posts, we wuda PMmed them to him. ur welcome to use anything u see here joseph, as long as u give credit to the author if ur gonna post it somewhere else or something like that.
 
0
•••
nasaboy007 said:
i found that if ur good at doing proofs in high school mathematics, ull be a good programmer cuz u need the same step by step mind frame. sry for the errors lol

I also wouldn't say that. I'm absolutly horrible at proofs. Failed almost every test that had proofs on it, (well failed the part with proofs at least). I think of myself as an average programmer with good PHP coding capabilities reguardless to this deficiency of my ability to do proofs. To be able to do PHP you have to be able to learn the syntax correctly, write PHP code efficiently, and try to catch mistakes as you go along. Small mistakes can really get you. I remember when I was a PHP noob, it took me a half-hour to realise that I missed a semi-colon somewhere :bah: . But :imho: proofs have nothing to do with PHP. Definition of "Mathematic Proofs": a proof is a demonstration that, given certain axioms, some statement of interest is necessarily true. More or less working backwards, and figuring out why something works. I can see that you'd relate this to finding the error to working backwards, but you shouldn't be making the error in the first place, and that's what you should be focusing on. A lof of programmers figure "Hey, I'll do a crappy job coding and let PHP tell me where all the errors are later". Tisk tisk to those programmers.

Wybe said:
Be secure and systematic in your coding, with attention. That'll certainly speed up your coding, because you don't have to debug parse errors and stuff.
Heh. Exactly what I was trying to say. Just noticed that post :P.

Ok, well I'm really bored, and sorry for the long post. I need to get a life. Bye for now.
 
0
•••
Appraise.net
Unstoppable Domains
Domain Recover
DomainEasy โ€” Live Options
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back