Php Short tags are a “no-no”
You shouldn’t use short php like this: value="http://<?=$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];?>"
Where does it come from?
Different servers, different php.ini files. You simply ran into the problem that short_open_tag = Off
is set. Not all servers have this set to true per default. Further more not all hosts allow editing the php.ini file – for good reasons.
Check ini settings
Try the follwing inside your code:
<?php echo 'short open tag: ' . ini_get('short_open_tag'); ?>
.
Set ini settings
If you see that it’s off you can try turning it on in your php.ini file using..
<?php ini_set('short_open_tag', 'ON'); ?>
.
Alternatively (per t31os’s suggestion)
If the login page is the first page on your site you request, there is no request URI to pass along, so naturally a redirect won’t happen because there’s no request URI to send you to.