Misc Links
Forum Archive
News Archive
File DB
 

Ads
 

Advertisement
Age of Valor - Ultima Online Free Shard
AoS/SE/ML/Custom - advanced code, dedicated staff, peerless bosses, non overpowered customs + much much more
 

Latest Forum Topics
Disable UAC in windows Vista/7/2008
Posted by Red Squirrel
on Jun 24 2009, 1:52:50 pm

IE 8 update error
Posted by rovingcowboy
on Jun 15 2009, 8:18:40 am

77' Chevy Nova
Posted by MikeDB
on Jun 25 2009, 4:36:46 pm

Bought a house
Posted by Triple6_wild
on Jun 15 2009, 3:22:07 am

computer desk chairs/office chairs
Posted by Onykage
on May 08 2009, 9:57:00 am

 



Send spam to: website@xeonlive.com nick@xeonlive.com georgiapeach1241@aol.com
Php how-to for starters
Taking web design to the next extreme
By Red Squirrel


Ever wonder how people make those fancy sites where you can type in information and it actually "updates the page" right away? Ever wonder how forums do that? It's actually quite simple. PHP means Hyper Text Pre Processor. PHP is basically html, but with advanced preprocessing features. The HTTP protocol transfers hyper text, so it is called a Hyper Text Transfer Protocol. PHP is a "phase" that the document goes through before it is sent out to the client. It "pre processes" the data before sending it in. This is also known as a dynamic document. Any forum you go to is dynamic. The same document on the server (usually index.php) is being loaded, but it does not always send the same thing to the client even if it is not manually updated by the webmaster. This image will show you in general how php documents are processed:

php parsing


Php does not only allow you to do cool stuff such as a forum, but it makes every webmaster's life much easier when running a website. While PHP is very good, it does have a few downsides, such as the fact that it is not something that "just works" like html. Html is simple because it is the exact document that is on the server, all the server does is send you the exact document when you request it, but php is a scripting language with html and it needs to be executed before sent. This requires that PHP is installed on the server. If it is not installed, the client simply gets the code, and not what the code is suppose to do since there's nothing to execute it. Another down side is that creating large/complex scripts can be difficult without a test server or unlimited bandwidth plan since you can't test it by just opening it in your browser but have to upload it every change to see if everything is going ok. As skills get better, you will be able to create complex scripts without uploading as often.

If you have two computers networked with a router, you can do a setup like mine. One of them can run as server, and also have a netbios share to the web server's directory, so you can open it on your main computer to edit and hit save, and then hit refresh on your browser which is opened to the page on the server. This makes it quick and easy to program, and makes it so you don't need to upload your files or anything.

On the next page, I'll show you how to get hooked up with a server capable of serving php pages.


Next Page
spacer
30575 Hits Pages: [1] [2] [3] [4] [5] 40 Comments
spacer


Latest comments (newest first)
Posted by Guest on March 03th 2006 (11:06)
Very interesting and beautiful site. It is a lot of helpful information. Thanks!
spacer
Posted by Cesar on January 01th 2006 (08:13)
Hello.
I am new at this, and I need to build a web page. I will use for sure PHP and MySQL. However, I am new at all this stuff, so I would really be thankfull if you could give me your oppinion on the following:
1) Is Apache the best solution to perform with PHP and MySQL?
2) I am not a programmer, so I have a lot to run... I have never worked with Linux, but for what I have read, it seams that using this applications with Linux is better than with Windows. What do you say on this?
3) I would like to have a forum (chat) and kind of a blog (comments to published notices). What would you advise me for each?? (At this point I realy don't know much even where to start, or what does it implies to administrate each one...)

thank you very much


spacer
Posted by viraj on October 10th 2005 (03:15)
hello
i have recently installed PHP designer 2005.
can u guide me for how to run php code in designer

spacer
Posted by halojoy on June 06th 2005 (21:36)
Yes, it is nice with scripts that does note produce notices.
isset is a good way to avoid this,
if you do not want to add a lot of code that sets 'empty' values for variables

Another way is to TURN OFF reporting of NOTICE
you add this, at top (beginning) of your php pages:
CODE
<?php

// Report ALL, but not NOTICE
error_reporting ( E_ALL & ~E_NOTICE );

// You will still get WARNINGS and other real ERRORS
// Notice is not an error, just a note
// To not have to add it in all your pages you can make it a line in 'config.php' ,
//  if you have such a file, that is included by php pages
?>
I use E_ALL = reporting with notices only when working with my code
When I am finished and put my code on website, I Turn Notice OFF, using that line.
I do not want to scare my visitors laugh.gif

spacer
Posted by Terry on June 06th 2005 (20:54)
Your article has been very useful. When I implemented your example it functioned as described with the exception that a number of notices were generated. All of the notices were complaining about undefined constants. After some digging around and experimentation I found that the notices could be eliminated by the use of isset and by quoting names in the $_GET and $_POST functions. For what it is worth the following is a rewrite of the example which, at least in my environment, eliminated all of the notices:
NOTE: The leading underscore characters, "_", at the start of some lines represent spaces and/or tabs.

<?php
____if(isset($_GET["act"]) && $_GET["act"]=="go")
____{
________echo("Your name is ".$_POST["name"].
____________" And your age is ".$_POST["age"].
____________"<br>Goodbye");
____}
____else
____{
?>

<form method="post" action="script.php?act=go">
____Enter your name: <input type="text" name="name"><br>
____Enter your age: <input type="text" name="age"><br>
____<input type="submit" value="done!">
</form>

<?php
____Return;
____}
?>

spacer
View all comments
Post comment

RPGBids Your MMO MMORPG Auction Super Site

Top Articles Latest Articles
- What are .bin files for? (534221 reads)
- Big Brother and Ndisuio.sys (134453 reads)
- PSP User's Guide (114964 reads)
- SPFDisk (Special Fdisk) Partition Manager (84273 reads)
- Text searching in linux with grep (81992 reads)
- Dynamic Forum Signatures (version 2) (2172 reads)
- Successfully Hacking your iPhone or iTouch (9674 reads)
- Ultima Online Newbie Guide (16534 reads)
- BBcode editor: PHP - The sensible approach (14009 reads)
- The Hitch Hikers guide to "the mouse" (12398 reads)
corner image

This site best viewed in a W3C standard browser at 800*600 or higher
Site design by Red Squirrel | Contact
© Copyright 2009 Ryan Auclair/IceTeks, All rights reserved