new installation help!

Forum for you who has PHP installation issues

Moderators: macek, egami, gesf

almightymike
New php-forum User
New php-forum User
Posts: 9
Joined: Mon Mar 10, 2003 7:42 pm

new installation help!

Postby almightymike » Tue May 20, 2003 2:49 am

here is what we're using

APACHE version 1.3.27
MySQL version 4.0.12
PHP version 4.3.1

all TAR.GZ files.

We can't seem to make PHP work right. I can see PHP info and the other simple PHP stuff.

some functionalities I noticed tht doesn't work was my sessions don't work
GetHostByName($REMOTE_ADDR) returns no value

what could we have done wrong? any ideas? by the way, were using Red Hat 8.

User avatar
Redcircle
Moderator
Moderator
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA
Contact:

Postby Redcircle » Tue May 20, 2003 8:35 pm

try

GetHostByName($_SYSTEM['REMOTE_ADDR'])

User avatar
mike
New php-forum User
New php-forum User
Posts: 73
Joined: Sun May 04, 2003 4:26 am
Location: Athens
Contact:

Postby mike » Fri May 23, 2003 6:04 pm

Set register_globals=On

almightymike
New php-forum User
New php-forum User
Posts: 9
Joined: Mon Mar 10, 2003 7:42 pm

Postby almightymike » Sun May 25, 2003 9:17 pm

YOU GOT IT MIKE! everythings seems to be working properly now!
Thanks!!

User avatar
Redcircle
Moderator
Moderator
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA
Contact:

Postby Redcircle » Sun May 25, 2003 9:53 pm

using register globals on is a security risk and SHOULD NOT be used. Yes it is a quick workaround but a dangerous one.

php.net doc wrote:By turning off the ability for any user-submitted variable to be injected into PHP code, you can reduce the amount of variable poisoning a potential attacker may inflict. They will have to take the additional time to forge submissions, and your internal variables are effectively isolated from user submitted data.


see http://www.php.net/register_globals for more information

almightymike
New php-forum User
New php-forum User
Posts: 9
Joined: Mon Mar 10, 2003 7:42 pm

Postby almightymike » Mon May 26, 2003 2:01 am

PHP should have set it to default a long time ago. before I developed my scripts. :x

now, how do I change it my variables so that it will work with register globals turned off :lol:

User avatar
bezmond
Moderator
Moderator
Posts: 312
Joined: Sat Apr 05, 2003 4:33 am
Location: Mansfield, UK
Contact:

Postby bezmond » Mon May 26, 2003 2:40 am

make your form submit as EITHER POST or GET, I recommend POST... to retrieve a variable, you then use:

Code: Select all

$variable = $_POST["variable"];


Andrew

User avatar
WiZARD
Moderator
Moderator
Posts: 1257
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol
Contact:

Postby WiZARD » Mon May 26, 2003 2:52 am

bezmond wrote:make your form submit as EITHER POST or GET, I recommend POST... to retrieve a variable, you then use:

Code: Select all

$variable = $_POST["variable"];


Andrew

as i know POST and GET it's two different way...

User avatar
bezmond
Moderator
Moderator
Posts: 312
Joined: Sat Apr 05, 2003 4:33 am
Location: Mansfield, UK
Contact:

Postby bezmond » Mon May 26, 2003 3:14 am

yeah sorry, meant to add...

if you use GET, you should do:
$variable = $_GET["variable"];

as I said, I suggest using POST, as GET sends variables in the URL, e.g. http://www.nowhere.com/file.php?x=1&y=2
etc etc

Andrew

User avatar
WiZARD
Moderator
Moderator
Posts: 1257
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol
Contact:

Postby WiZARD » Mon May 26, 2003 3:25 am

bezmond wrote:yeah sorry, meant to add...

if you use GET, you should do:
$variable = $_GET["variable"];

as I said, I suggest using POST, as GET sends variables in the URL, e.g. http://www.nowhere.com/file.php?x=1&y=2
etc etc

Andrew

not only....
if you use GET, than line string in youre browser shortest only 255 signs, and ones more GET work faster!

User avatar
bezmond
Moderator
Moderator
Posts: 312
Joined: Sat Apr 05, 2003 4:33 am
Location: Mansfield, UK
Contact:

Postby bezmond » Mon May 26, 2003 3:42 am

ok ok, personally, I prefer POST... the majority of forms I've used on my website send information that I need to keep secured, e.g. a username, password etc... so I use POST to help me that little bit more...

the other way, would be to encrypt it... e.g. submit everything with md5($variable) I suppose, but that's long-winded...

Andrew

User avatar
WiZARD
Moderator
Moderator
Posts: 1257
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol
Contact:

Postby WiZARD » Mon May 26, 2003 4:26 am

bezmond wrote:ok ok, personally, I prefer POST... the majority of forms I've used on my website send information that I need to keep secured, e.g. a username, password etc... so I use POST to help me that little bit more...

the other way, would be to encrypt it... e.g. submit everything with md5($variable) I suppose, but that's long-winded...

Andrew

I'm just give info about GET and POST :wink:


Return to “PHP Installation”

Who is online

Users browsing this forum: No registered users and 1 guest