Jump to content

Archived

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

slopok

Need a couple php questions answered

Recommended Posts

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:

[img]http://i13.photobucket.com/albums/a299/slopok8225/MagicalSnap-2006-1.jpg[/img]

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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? 

Share this post


Link to post
Share on other sites
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.


[IMG]http://i13.photobucket.com/albums/a299/slopok8225/MagicalSnap-2006-4.jpg[/img]

[IMG]http://i13.photobucket.com/albums/a299/slopok8225/MagicalSnap-2006-3.jpg[/img]

[IMG]http://i13.photobucket.com/albums/a299/slopok8225/MagicalSnap-2006-3.jpg[/img]

Share this post


Link to post
Share on other sites
[quote author=slopok link=topic=112735.msg457771#msg457771 date=1161834803]
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.
[/quote]

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..

Share this post


Link to post
Share on other sites
Undefined constant notices are signs of sloppy coding. He is trying to reference array keys without quotes. eg;

[code=php:0]
foo[bar];
[/code]

Instead of...

[code=php:0]
foo['bar'];
[/code]

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.

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.