Jump to content


Photo

Newbie Help Not only newbie but migrating from PHP 4 to 5


  • Please log in to reply
1 reply to this topic

#1 flhtc

flhtc
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 06 October 2006 - 01:32 AM

Hi,

I'm brand new to PHP programming.  So please pardon my ignorance.  After all, ignorance is simply the lack of knowledge, not the ability to learn.

Not only am I new to this, I've also been challenged to migrate a PHP based Electronic Change Notificaton program which also relies heavily on MySQL from PHP ver. 4.0.4 to 5.0.4. Apache ver. 1.3.12 to Apache 2.0.54  As my first challenge.  Now I've been scripting (ksh) and doing basic C programing in different *nix systems for a dozen years or so, so I'm no ID-10-T when it comes to programming.  I've been doing a lot of reading here regarding PHP, MySQL and such.  I've seen how variables now should be (for lack of a better term) delcared before being used.  I've also learned a bit about syntax.  The online manual is awsome! 

I had the program up and running on the new server in about 20 minutes once I figured out how to set the php.ini file to be compatible (as near as I can figure).  There are a ton of notices regarding undefined variables, indexes, and offsets.

What I need help with here is finding the differneces between the two versions.  What should I be looking for in the V4 program that V5 doesn't like?  Is there a place on this or other sites that would give me a good rundown?

Trust me there will be a lot more questions regarding the best way to initialize variables, sharing them between pages, etc... once I learn a bit more.

Thanks in advance,
FLHTC
I'd rather have a bottle in front of me, than a frontal lobotomy!!!

#2 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 06 October 2006 - 01:42 AM

Your biggest difference here is probably just a configuration issue. Older versions of php had register globals switched on, it is now (for security reasons) switched off by default.

Register globals (amongst other things) automatically parsed variables sent via get or post into local variables. So, instead of having to use the new $_GET['id'], you could simply use $id.

This is no longer supported and I would never recommend switching registr globals back on. You'll need to change your code accordingly.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users