我需要使用PHP/MySQL保存Flash游戏的高分,但它不起作用
这是代码:
AS3
ActionScript:
var myrequest:URLRequest = new URLRequest("score.php");
myrequest.method = URLRequestMethod.POST;
var variables:URLVariables = new URLVariables();
variables.name = nombrem;
variables.score = puntosJugador;
myrequest.data = variables;
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.addEventListener(Event.COMPLETE, dataOnLoad);
loader.load(myrequest);
Run Code Online (Sandbox Code Playgroud)
PHP
//Include database connection details
require_once('config.php');
//Connect to mysql server
$link = mysql_connect([b]**HOST**, **USERNAME**, **PASSWORD**[/b]D);
if(!$link) {
die('Failed to connect to server: ' . mysql_error());
}
//Select database
$db = mysql_select_db(**DATABASENA**);
if(!$db) {
die("Unable to select database");
}
//Function to sanitize values received …Run Code Online (Sandbox Code Playgroud) 我不知道为什么这个css工作时我在body标签设置为100%高度时使用背景图像但是当我在div上使用它时它没有显示全高(仅显示屏幕高度)
这是代码:
<body>
<div id="bg">
</div>
</body>
Run Code Online (Sandbox Code Playgroud)
CSS
body{
position:relative;
padding: 0;
overflow-x: hidden;
font-family: "Titillium Web";
color:#fff;
width: 100%;
}
#bg{
height:100%;
background-color: #030000;
background-image: url(img/bg.jpg);
background-repeat: no-repeat;
background-position: top center;
background-size: 100% auto;
}
Run Code Online (Sandbox Code Playgroud)
我不想使用背景尺寸:请盖好