PHP doesnt seem to work on my Direct Admin server??

phpMyHosting

Verified User
Joined
Jul 27, 2003
Messages
5
i have a page at
http://www.phpmyhosting.com/support/test.php
with the code


CODE

<form method="POST" action="test.php">
<input type="text" name="text">
<input type="submit" name="submit">
</form>
<? echo($text);?>




And for some reason the page does not display what you send in the textbox. Any ideas?
Also my includes are not working..


CODE

<?
include ($DOCUMENT_ROOT . "/header.php");
?>




the form and the includes work on all the other servers i have tried except for the Direct Admin one.
Any ideas?

Mike
 
ah, that worked, how do i go about fixing it then? i dont want to change all my files from <? echo($text);?> to <? echo($HTTP_POST_VARS["text"]);?>!!

Mike
 
Turn the register_globals variable on in your php.ini. This, however, is not suggested. Any script written to use register_globals is poorly written, because it:

1) Is at greater risk of being hacked.
2) Decrease script performance.

But, if you must have register_globals, it can be turned on in the php.ini file.
 
but all the other servers i have used.. cpanel, ensim and plesk all work with the first script
 
That is because they had register_globals enabled. The PHP developers do not recommend using it, however the feature is still available to those who need it.
 
oh right, but if the larger CPs use it then it must be ok to have it enabled yea? If it was a security risk they wouldnt do it otherwise no one would use their CP as it would be unstable
 
It is overall a bad programming practice to use register_globals, all of the control panel developers know this. They keep it enabled because they are well aware that there are a signficant number of people who do not understand the downsides to it.

Simply put: lazy or inexperienced programmers utilize register_globals (on) because they do not know enough to do otherwise. Unfortunately, a vast majority of "PHP scripters/programmers" are lazy or inexperienced, and for this reason, register_globals is defaulted on by all other control panels.
 
loopforever is correct, It's Insecure and that's why php recommends to have it disabled/off.


If you want to turn on Register Globals go to a phpinfo.php page on your server or create it yourself:

<?php phpinfo(); ?>

It will tell you where is the php.ini
then in the shell :
pico /path/to/php.ini

and search for register globals and turn them on.

Then restart apache : service httpd restart

I did not get my hands on a server with Direct Admin installed on so I do not know where they have their php.ini stored.

it should usually be either:
/etc/php.ini
or
/usr/local/lib/php.ini
 
Back
Top