![]() |
![]() |
#1 (permalink) |
Huggles, sir?
Location: Seattle
|
[php] Newbie-friendly PHP "Lessons"
I've had half a dozen people ask me to teach them PHP in the last few months, so I decided to start working on some easy to understand PHP lessons to help people teach themselves the basics. I only have a couple finished right now, and am always looking for some input, so even if you know PHP already, let me know what you think of these. I am including them in a couple of formats -- text, in the post below, and tarred/gzipped links so you can download them.
Lessons: 00 - What is PHP? - ( Scroll Down ) 01 - Comments - ( Download Link ) 02a - Variables - ( Download Link ) 02b - Variables - Arrays - ( Download Link ) 03a - Loops - if/else - ( Download Link ) 03b - Loops - for/foreach - ( Download Link ) 04 - Functions
__________________
seretogis - sieg heil perfect little dream the kind that hurts the most, forgot how it feels well almost no one to blame always the same, open my eyes wake up in flames Last edited by seretogis; 11-20-2003 at 01:52 AM.. |
![]() |
![]() |
#2 (permalink) | |
Huggles, sir?
Location: Seattle
|
Lesson 00 - What is PHP?
Quote:
Lesson 01 - Comments PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
__________________
seretogis - sieg heil perfect little dream the kind that hurts the most, forgot how it feels well almost no one to blame always the same, open my eyes wake up in flames Last edited by seretogis; 11-20-2003 at 01:50 AM.. |
|
![]() |
![]() |
#6 (permalink) |
Desert Rat
Location: Arizona
|
Is there a way to test php code without having to upload it to a server? Like a program for a virtual enviroment or something
<--Php newbie
__________________
"This visage, no mere veneer of vanity, is it vestige of the vox populi, now vacant, vanished, as the once vital voice of the verisimilitude now venerates what they once vilified. However, this valorous visitation of a by-gone vexation, stands vivified, and has vowed to vanquish these venal and virulent vermin vanguarding vice and vouchsafing the violently vicious and voracious violation of volition. The only verdict is vengeance; a vendetta, held as a votive, not in vain, for the value and veracity of such shall one day vindicate the vigilant and the virtuous. Verily, this vichyssoise of verbiage veers most verbose vis-à-vis an introduction, and so it is my very good honor to meet you and you may call me V." - V |
![]() |
![]() |
#7 (permalink) | |
In Your Dreams
Location: City of Lights
|
First of all.. great idea seretogis!
Quote:
Windows: HTTP Server: I recommend Apache. Windows 2000 and XP comes with IIS (Microsoft's Web Server), but as I've never used PHP w/ it, I won't talk about it. As gigawatz said, it is a good quick 'n dirty test enviroment. Google for IIS+PHP if you want to try that. You can get the latest version of Win32 Binaries for Apache at: http://www.apache.org/dyn/closer.cgi...inaries/win32/ I suggest a 2.x version. At the time of this writing, apache_2.0.48-win32-x86-no_ssl.msi would be appropriate for you. Use the .exe version if you don't have the MSI installer (chances are you already do. XP, 2K, and ME comes with it). Note: If you're using XP, you need to have XP SP1 installed. PHP: You can get PHP from: http://www.php.net/downloads.php At the time of this writing, the latest stable version is 4.3.3. You can get it here: http://www.php.net/get/php-4.3.3-ins.../from/a/mirror Setup: Once you install those two programs (apache first, then PHP), edit your apache configuration and add this: ScriptAlias /php/" c:/path-to-php-dir/" AddType application/x-httpd-php .php Action application/x-httpd-php "/php/php.exe" Then start the Apache service and you should be able to run PHP scripts with no problems. Other: There are distributions out there that install everything for you in one big go (and usually come with MySQL, a Database Management System). I've never tried these, so can't verify how good they are. I don't have any links, but I'm guessing you could google for them. Also, below's some links with more indepth insturctions on setting up Apache/PHP/MySQL. Good luck! http://www.coe.uncc.edu/~asingh/setup_apm.htm http://www.weberdev.com/ViewArticle.php3?ArticleID=86 Linux HTTP Server: Once again, Apache 2.x is recommended. You can get it from: http://httpd.apache.org/download.cgi Just chose one of the Unix sources. PHP: You can get PHP from: http://www.php.net/downloads.php. Just choose one of the sources. Other: You may want to install MySQL as well. Setting up Apache/PHP on Linux can be a pain, but not too bad. Below are some sites that give you good insturctions on how to do it. These may also go through installing other stuff, like SSL. http://www.weberdev.com/ViewArticle.php3?ArticleID=378 http://www.devshed.com/Server_Side/P...inglySeamless/ http://www.linuxguruz.com/z.php?id=3...p+mysql+apache General Links: The following link(s) will give you setup/install instructions for either Linux or Windows. http://www.php.net/manual/en/install.apache2.php OK. That's it. Good Luck. If anyone has anything to add to this or thinks should be changed, just reply to the thread and I'll add it in. Last edited by Latch; 11-04-2003 at 04:06 PM.. |
|
![]() |
![]() |
#8 (permalink) |
Desert Rat
Location: Arizona
|
Wow way more information than I expected someone to give. Thank you for taking the time to list those resources for me and anyone else interested.
__________________
"This visage, no mere veneer of vanity, is it vestige of the vox populi, now vacant, vanished, as the once vital voice of the verisimilitude now venerates what they once vilified. However, this valorous visitation of a by-gone vexation, stands vivified, and has vowed to vanquish these venal and virulent vermin vanguarding vice and vouchsafing the violently vicious and voracious violation of volition. The only verdict is vengeance; a vendetta, held as a votive, not in vain, for the value and veracity of such shall one day vindicate the vigilant and the virtuous. Verily, this vichyssoise of verbiage veers most verbose vis-à-vis an introduction, and so it is my very good honor to meet you and you may call me V." - V |
![]() |
![]() |
#9 (permalink) |
Crazy
Location: Pittsburgh
|
If you are using XP or 2K apache is not needed, IIS is an option. Due to the fact that this is going to be a personal test system/location IIS will do you just fine. It is provided with the operating system. Then you can locate a php plugin for IIS on php.net. It most likely will be easier to do than the apache + php combination.
However, I am not saying that IIS + php is better, only easier for a quick and dirty test environment. |
![]() |
![]() |
#10 (permalink) |
Desert Rat
Location: Arizona
|
So I have apache installed, downloaded the php program latch recommended, and put the configs in the right place. Now what? I tried making a small *.php file in notepad and I tried running it and of course it wasn't associated with anything. tried it in internet explorer and that was a no-go as well. What do I do?
__________________
"This visage, no mere veneer of vanity, is it vestige of the vox populi, now vacant, vanished, as the once vital voice of the verisimilitude now venerates what they once vilified. However, this valorous visitation of a by-gone vexation, stands vivified, and has vowed to vanquish these venal and virulent vermin vanguarding vice and vouchsafing the violently vicious and voracious violation of volition. The only verdict is vengeance; a vendetta, held as a votive, not in vain, for the value and veracity of such shall one day vindicate the vigilant and the virtuous. Verily, this vichyssoise of verbiage veers most verbose vis-à-vis an introduction, and so it is my very good honor to meet you and you may call me V." - V |
![]() |
![]() |
#12 (permalink) | |
In Your Dreams
Location: City of Lights
|
Quote:
Good luck! |
|
![]() |
![]() |
#14 (permalink) |
Banned
Location: UCSD, 510.49 miles from my love
|
hello world, how classic...
Code:
class HelloWorld { public static void main(String args[]) { String greeting = "Hello"; System.out.println(greeting + " World!"); } } boolean truth = (php >= java); looking forward to more. [edited to correct logic error, may as well be accurate] Last edited by numist; 11-11-2003 at 11:11 PM.. |
![]() |
![]() |
#16 (permalink) | |
Huggles, sir?
Location: Seattle
|
Quote:
![]() Lesson 3a, on the if/else loop, is now available. Also, I renamed Lesson 2 (variables) to Lesson 2a, and added a Lesson 2b which deals with arrays.
__________________
seretogis - sieg heil perfect little dream the kind that hurts the most, forgot how it feels well almost no one to blame always the same, open my eyes wake up in flames Last edited by seretogis; 11-12-2003 at 04:40 PM.. |
|
![]() |
![]() |
#20 (permalink) | |
Huggles, sir?
Location: Seattle
|
Quote:
Also, Lesson 03b - Loops - for/foreach has been posted. Have fun!
__________________
seretogis - sieg heil perfect little dream the kind that hurts the most, forgot how it feels well almost no one to blame always the same, open my eyes wake up in flames |
|
![]() |
Tags |
lessons, newbiefriendly, php |
|
|