Misc Links
Forum Archive
News Archive
File DB
 

Ads
 

Advertisement
 

Latest Forum Topics
wow 56 k modems are
Posted by Red Squirrel
on Oct 14 2013, 11:52:23 pm

I Need A Program
Posted by rovingcowboy
on Sep 23 2013, 5:37:59 pm

having trouble witn lan
Posted by rovingcowboy
on Sep 23 2013, 5:40:56 pm

new problem for me
Posted by rovingcowboy
on Sep 23 2013, 5:54:09 pm

RBC Royal Bank
Posted by Red Squirrel
on Aug 13 2013, 6:48:08 pm

 

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
24950 Hits Pages: [1] [2] [3] [4] [5] 28 Comments
spacer


Latest comments (newest first)
Posted by halojoy on June 06th 2005 (22: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 Red Squirrel on November 11th 2004 (14:13)
You need to run it off a webserver that has php installed.

So you would type http://serverhost/script.php


spacer
Posted by Red Squirrel on October 10th 2004 (16:32)
It means you have a syntax error in your mysql query, unfortunatly mysql is not very helpful at telling WHAT the error is, so you'll have to figure that part out. Post the query and maybe I can look at it and find the problem.
spacer
Posted by jewboy419 on October 10th 2004 (15:34)
pressanykey.gif i am doing a php on euoropean lycos and i get an error when using this code: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near" the first line of the code... can' anyone help!!!
spacer
Posted by sintekk on October 10th 2004 (11:18)
QUOTE (Red Squirrel @ Jul 6 2004, 08:41 PM)
Tripod actually has php amd mysql? That's cool, I did not know that.

Only the European lycos, the US one still believes that everybody that wants a website with them just wants to make a Hillary Duff fan page laugh.gif

...now only if there was a free ColdFusion host out there sad.gif...

spacer
View all comments
Post comment


Top Articles Latest Articles
- What are .bin files for? (669062 reads)
- Text searching in linux with grep (161180 reads)
- Big Brother and Ndisuio.sys (150471 reads)
- PSP User's Guide (139547 reads)
- SPFDisk (Special Fdisk) Partition Manager (117240 reads)
- How to Use MDADM Linux Raid (188 reads)
- What is Cloud Computing? (1225 reads)
- Dynamic Forum Signatures (version 2) (8769 reads)
- Successfully Hacking your iPhone or iTouch (18714 reads)
- Ultima Online Newbie Guide (35906 reads)
corner image

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