Jump to content

Archived

This topic is now archived and is closed to further replies.

Eiolon

Learning PHP - a couple questions...

Recommended Posts

I hope this is the appropriate forum for this:

1. Should I start with PHP4 or 5?  I know this question seems strange but I didn't know if PHP5 was new and not fully developed or not.  I notice lots of people still using PHP4.

2. I have Dreamweaver 8.  I know it has built-in PHP functions.  I know that using them doesn't teach me PHP but if I were to use them as examples of code, would that be a good idea?  I was once told by someone the PHP functions may not be secure the way they are coded, regardless if they work or not.

Thanks!

Share this post


Link to post
Share on other sites
use  a stable version of php4

Share this post


Link to post
Share on other sites
[quote author=Eiolon link=topic=100379.msg396083#msg396083 date=1152756631]
I hope this is the appropriate forum for this:

1. Should I start with PHP4 or 5?  I know this question seems strange but I didn't know if PHP5 was new and not fully developed or not.  I notice lots of people still using PHP4.
[/quote]

You should learn PHP5. It is much better for object oriented programing. Object oriented programing is easier to learn for many people that procedural programing, which PHP4 is better for than PHP5. If you plan on to use your scripts or system on a live website you will find it difficult to find hosting companies supporting PHP5 (for whatever reason this seems due to the slow adoption of some control pannels supporting PHP5). If you are learning PHP purely for the sake of learning it, then you would be a fool not to learn PHP5. If you do any serious programing in PHP4 you will have to know PHP5 well so that your scripts do not break when (and not if) PHP4 becomes obsolete.

Share this post


Link to post
Share on other sites
You should learn PHP -- either 4 or 5. Right now it's easier to find hosts that run PHP4 than hosts that run PHP5. You don't have to write OOP code to use PHP5. I write perfectly good scripts using PHP5 which are backwards compatible to PHP4. I'm just very careful to only use those functions that are in the version of PHP that I will be running on the live server. I do most of my coding on my laptop (xampp with PHP v5.05). The production machines are running either 4.3.10 or 4.3.9 depending on the host.

Don't let the OOP style of programming scare you away from PHP5.

For some of us "old-timers", the OOP style is hard to learn (although it is getting easier).

Ken
(started programming professionally over 30 years ago!)

Share this post


Link to post
Share on other sites
[quote]but if I were to use them as examples of code, would that be a good idea?[/quote]
No... Dreamweaver creates some of the worst examples of php code I have ever seen.

Share this post


Link to post
Share on other sites
[quote author=thorpe link=topic=100379.msg396165#msg396165 date=1152776831]
[quote]but if I were to use them as examples of code, would that be a good idea?[/quote]
No... Dreamweaver creates some of the worst examples of php code I have ever seen.
[/quote]
I would have to agree with that! You should not use Dreamweaver for PHP coding. To get the best out of PHP you should get an app that is specificly designed to help your develop your PHP scripts, such as an IDE. There are many of them out of there free or paid.

Also it doesnt matter which version you use. The big difference between PHP4 and PHP5 is the OOP side og things, you can still do OOP coding for PHP4 but is limited. Also with PHP there are a few functions that only work with PHP5.

Alot of hosts use PHP4, but it doesnt matter if your host doesnt have PHP5 as your script will still run, accept if you are using PHP5 only function, which there are very few. Also keep in mind many hosts tend to have a setting called register_globals enabled which can break your scripts! So before your start coding away creating your uber perfect PHP app ask your host whether they have a setting called [url=http://uk2.php.net/register_globals]register_globals[/url] enabled.

Share this post


Link to post
Share on other sites
Object Oriented Programming.

[url=http://uk2.php.net/oop]PHP4 OOP[/url]
[url=http://uk2.php.net/manual/en/language.oop5.php]PHP5 OOP[/url]

Share this post


Link to post
Share on other sites
Thanks for your help everyone.  I forgot to ask.  I have access to CodeCharge Studio 3.  Is that any good for PHP examples?

Share this post


Link to post
Share on other sites
I have no idea what CodeCharge is, but Dreamweaver is GREAT for php coding because the syntax coloring helps you see when you forget semi-colons or commas, etc. And you can keep track of your {} much easier.

www.daydreamgraphics.com has lots of easy PHP tutorials that explain everything and help you learn to write your own scripts.

For me, I bought a PHP/mySQL book and I used it non-stop. It's so helpful, and it's how I learned to write PHP code.

Also, you should download the latest PHP manual. It lists all sorts of helpful functions and lots of user-submitted functions.

Share this post


Link to post
Share on other sites
May I ask which book you are using?  I am going to Borders tonight to get a couple.

EDIT: Wow, that site you linked to is really simple and informative on its tutorials.  I am sure I will learn a lot from it.

Share this post


Link to post
Share on other sites
^ Yep! The girl that runs it, Snow White, also has a forum there with lots of helpful people. They're all really nice, too. :) The tutorials are simple, and that's where I started learning from, too.

I'm learning Visual QuickPro (not quickstart) guide to PHP & MySQL by Larry Ullman. It has complete examples in it like making shopping carts, content management, user log in--plus it's all explained step by step. It's only like $25 and was worth EVERY penny.

Share this post


Link to post
Share on other sites
Dont use dreamweaver for php programming as i am learning php and all the code gets all confuesing in page view.

Take the above advice.

I use notepad it's free and it also false me to learn properly.

good luck. 

Share this post


Link to post
Share on other sites
Snow White, Sleeping Beauty, and Pocahontas used Dream Weaver too.  It was soooo prettty.

Share this post


Link to post
Share on other sites
pmsl

lol........................................


if(!$a['dreamweaver']){
echo" sorry but your lazy get a life !";
}else{
echo"use notpad";
}

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.