-4
<html>
<head>
<link type="text/css" rel="stylesheet" href="stylesheet.css"/>
<title>Introduction Process</title>
</head>
<?PHP
$window_width=0;
$window_width= '<script>window.screen.availWidth</script>';
if $window_width <= 500 {
$Link = "SignUp.php";
}
else{
$Link = "1stPage.php";
}
?>
<Body>
<center><img src="Alex.png" alt="" align="middle"></center>
<center><div>Hello, I am Alex. I am here to walk you through an 11 question quiz which will help calculate your resilience level.</div></center>
<FORM NAME ="form1" METHOD ="POST" ACTION =<?PHP echo $Link; ?>>
<center><INPUT TYPE = "Submit" class=myButton Name = "Submit1" VALUE = "Start"></center>
</FORM>
</body>
</html>
我想測試屏幕的大小,所以我知道要不要將它們發送到我的移動網站或全尺寸網站,我收到此錯誤「解析錯誤:語法錯誤,意外'$ window_width'(T_VARIABLE),期待'('在C:\ wamp64 \ www \ IntroductionProcess.php 12行上「Javascript屏幕大小如果其他語句
對於一件事,那就是現在你如何編寫'if'語句。另外,*** JavaScript不會在服務器上運行!*** –
您不需要PHP。你可以簡單地使用HTML。看看[這裏](https://developers.google.com/webmasters/mobile-sites/mobile-seo/separate-urls)。 –