I have the following PHP script (file.php) which shows the current time and displays the user's input:
Current time:
<?php
$time=time();
$actual_time=date('H:i:s',$time);
echo $actual_time;
//show user input
$enter=@$_POST['enter'];
echo '<br>Input: '.$enter;
?>
<form action="" method="POST">
<input type="text" name="enter">
<input type="submit" value="Refresh">
</form>
By default the page shows this:

If I enter e.g. <strong>test</strong>, I see this:

And if I enter <iframe src="file.php"></iframe>, I can reload the page in a smaller window:

So, now, how could I display the raw PHP script (file.php) by submitting some certain HTML code in the INPUT text field?

file.phpshould be a string containing the file name:<?php echo highlight_file('file.php'); ?>.... this is where actually reading the documentation helps youXSS. If you try to show sources for a legimate reason - you have to change a code and use for example<?php echo highlight_file('file.php'); ?>