這是我第一個基於PHP的web項目。我的網絡部分工作完美,但我在移動版本遇到問題。 (在godaddy linux上的虛擬主機)我是否必須在移動設備上使用不同的PHP?
我的.php頁面不顯示的原因是什麼?如果我將其更改爲.html,它工作正常。 (我懷疑的文檔類型,但不知道。) 不知道這個代碼是必要的,但我會離開了身體空間的緣故:
<?php include_once 'web/config.php'?>
<!DOCTYPE HTML>
<html>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN"
"http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>About - Mobile</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="keywords" content="About - Mobile" />
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
</head>
的config.php:
$link = mysqli_connect($server, $db_user, $db_pass);
mysqli_select_db($link, $database);
// -=-=-=-=-=-=-=[ Getting Variables ]=-=-=-=-=-=-=- //
$query = "SELECT * FROM `misc`";
$result = $link->query($query);
while($info = mysqli_fetch_array($result)){
// -=-=-=-=-=-=-=[ Variables ]=-=-=-=-=-=-=- //
$pickupTime = $info['pickupTime'];
$deliveryTime = $info['deliveryTime'];
$minDeliveryPrice = $info['minDeliveryPrice'];
$Gtitle = $info['Gtitle'];
$emailAccount = $info['emailAccount'];
$phone = $info['phone'];
$mailSubject= $info['mailSubject'];
$address = $info['address'];
$city = $info['city'];
$zipcode = $info['zipcode'];
$companyTel = $info['companyTel'];
$companyEmail = $info["companyEmail"];
$facebookLink = $info['facebookLink'];
$twitterLink = $info['twitterLink'];
$googleLink = $info['googleLink'];
$termsOfService = $info['termsOfService'];
}
?>
在此先感謝!
這對你來說真的看起來像有效的HTML嗎? –
php無法關心您使用的是什麼設備。 PHP的工作是(一般)生成HTML。您需要爲用戶的設備生成適當的html。 –
您是在手機本身上運行此文本,還是您網站的移動版本?除非你有一臺服務器,否則PHP將無法工作;它是服務器端。 –