Hi I have a form with a php code in it that works fine on apple mac osx, using <? echo $PHP_SELF;?> it refreshes and loads the same page. However when I test it on windows xp, it opens default xx.com/php.index page instead. I am using apache server, by the way. Any help is much appreciated.
For some reason, I want to say that needs to be: <? echo $_SERVER['PHP_SELF']; ?> and I think the reason is a change in PHP from v4 to v5. edit: of course if you are including that page in another that is the page that will be refreshed (the main, not the included).
Just another thing to watch out for is using shortened PHP Tags like you have. <? echo $_SERVER['PHP_SELF']; ?> Some servers need the full deal <?php echo $_SERVER['PHP_SELF']; ?> But you'll know if that happens. You can also use <?=$_SERVER['PHP_SELF']?> which works on some servers as well. To be safe it's best to use the longer format. Just my 2 cents worth. Cheers Tim
'<?=' will work as a replacement for '<?php echo ' anywhere short tags are enabled. I always use the long tags... I believe it's easier to just expect that short tags is disabled.