using Documentation on IIS;
<?php
$key = '**********';
$value = '**********';
session_start ( );
$code = $_REQUEST [ 'code' ];
if ( empty ( $code ) )
{
$_SESSION [ 'state' ] = md5 ( uniqid ( rand ( ) , true ) );
$dialog_url = 'https://www.facebook.com/dialog/oauth?client_id=' . $key . '&redirect_uri=' . urlencode ( $value ) . '&state=' . $_SESSION [ 'state' ];
echo('<script> top.location.href=' . $dialog_url . ';</script>');
}
?>
Result:
top.location.href=' . $dialog_url . ';'); } ?>
Please try your suggestion before posting it as I have tried more than 40 suggestions, reviewed all similar questions and searched it for last 2 hours.
Your server do not parse your file as php. That’s the symptom.
See how to configure your IIS server for parse html file as PHP.
EDIT for completeness:
As mentioned by other answers you should add double quotes around
$dialog_urlfor prevent javascript error