Hallo Christian, natürlich geht das völlig unkompliziert:
<html><head><title>Test</title>
<?
echo "<script type="text/javascript">
<!--
fensterbreite = screen.width
if(screen.width >= 1024)
document.write (fensterbreite)
else
window.location.href = "datei_2.htm"
//-->
</script>";
?>
</head><body>
</body></html>
Beachte bitte die Backslash's vor den doppelten Anführungszeichen!!!
MfG martin