Jump to content


Photo

Need a couple php questions answered


  • Please log in to reply
5 replies to this topic

#1 slopok

slopok
  • New Members
  • Pip
  • Newbie
  • 2 posts
  • LocationNew Mexico, USA

Posted 26 October 2006 - 01:25 AM

If a site was created using php 4 will it run without any trouble on a server using php 5 only?

my programmer says that since he created the site using php 4 that thee lack of "globals" with php 5 is causing the major problems that we are experiencing on the site. see below for an image of some of the thousands of notices on the site:

Posted Image

Can anyone looking at these errors tell me what the problem isand if he is just lieing to me so he has less work to do?

#2 JustinK101

JustinK101
  • Members
  • PipPipPip
  • Advanced Member
  • 503 posts
  • LocationSan Diego, California, US

Posted 26 October 2006 - 02:21 AM

Yeah if it used register globals then changing all the variables from $myvar to $_GET['myvar'] or $_POST['myvar'] would be a major pain in butt.

I would say if you have access to your php.ini simply turn on register globals. I have register global on in my php5 setup.

#3 doni49

doni49
  • Members
  • PipPipPip
  • Advanced Member
  • 515 posts
  • LocationCentral MO

Posted 26 October 2006 - 02:29 AM

It sounds to me like he's talking about the fact that his code uses "Register Globals".  And nowadays most people disable register globals for security reasons.

And I don't think it really matters about php4 vs php5.  The security concerns are the same in either version.

EDIT:  I was getting ready to hit post but I noticed something in the image (I can barely read it because it's too small).  I still think it's an issue with RG.  But the issue I just noticed is that the error messages say "Use of undefined constant".  That usually means that the code is trying to use a variable but the variable isn't defined properly:

//GOOD
$a = 1;
echo $a;

//BAD--Will throw similar errors
$a = 1;
echo a;  //it sees that it's not a string because there are no quotes and because there is no $ in front of a, it assums you mean to use a CONSTANT.

Any way you can post the code that's producing this? 
Don

#4 slopok

slopok
  • New Members
  • Pip
  • Newbie
  • 2 posts
  • LocationNew Mexico, USA

Posted 26 October 2006 - 03:53 AM

My programmer has the "I am god gretest gift to man kind and computer programming in almost any forms.  My problem with this, is I have to bow down to his words, because I honestly do not know what to believe or not believe.

Can you give me any specifics on how I can turn on to the php.ini and then what whould need to be used to change the file?

Is there anyone that would be willing to go check out the game site to see exactly what is going on?  If so you may get me either here on MSN or AIM is slpksf5thgrp.  I would greatly appreciate anyone help in here. Even ideas that I might sent to him to check a setting or anything like that.  The more help you can give me the better a foot I have to stand on when confronting his lack of action.

I just do not undestand why it worked fine on all other hosting compnaies, but thi one installs plesk and plesk atumatically install the php 5.I will get a bigger screenshot for you to look at more closely.


Posted Image

Posted Image

Posted Image



#5 btherl

btherl
  • Staff Alumni
  • Advanced Member
  • 3,893 posts
  • LocationAustralia

Posted 26 October 2006 - 04:57 AM

My programmer has the "I am god gretest gift to man kind and computer programming in almost any forms.  My problem with this, is I have to bow down to his words, because I honestly do not know what to believe or not believe.


Hmmm.. tell him that you asked lots of people and no-one else could fix it.. you have no-one to turn to other than him and his godlike programming skills :)  A big ego can be used to your advantage..

#6 trq

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

Posted 26 October 2006 - 05:14 AM

Undefined constant notices are signs of sloppy coding. He is trying to reference array keys without quotes. eg;

foo[bar];

Instead of...

foo['bar'];

This is pretty simple stuff. Nothing to do with the differences between php4 and php5, some settings are different is all. Any decent programmer would avoid such issues in the first place.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users