当我将它上传到我的服务器并在浏览器中导航到它时,我的 PHP 页面是空白的。
<form action="welcome.php" method="get">
<input type="text" name="name" placeholder="enter first and last name" >
<br />
<input type="image" value="Submit" id="submit"/>
</form>
在welcome.php 页面上:
$fullName = $_GET['name'];
$firstName = explode(' ',trim($fullName));
<h2>Welcome <?php echo $firstName[0] ?>!</h2>
解决了。权限问题。PHP 文件必须是644
,而不是666
.