嗨,我想知道您是否有一个 webview 显示其中包含 php 的 url,如果您必须对其进行配置以读取 php,因为它不读取它,它只显示 php 代码。以下是当我尝试显示 Web 视图时它发回给我的内容。
<?php
$firstName = $_POST["firstName"];
$lastName = $_POST["lastName"];
$dormName = $_POST["dormRoom"];
$roomNumber = $_POST["roomNumber"];
$pizzaType = $_POST["PizzaType"];
$fp = fopen($firstName . "_" . $lastName . ".txt", "a"); // the 'a' will append to the end of the file.
fwrite($fp, "First Name: $firstName");
fwrite($fp, "Last Name: $lastName");
fwrite($fp, "Dorm Name: $dormName");
fwrite($fp, "Room Number: $roomNumber");
fwrite($fp, "Pizza Type: $pizzaType");
fclose($fp);
?>