[mysql]在 Android 的浏览器中运行 web

标签: html5 MySQL PHP
发布时间: 2016/10/15 23:46:56
注意事项: 本文中文内容可能为机器翻译,如要查看英文原文请点击上面连接.

我有一个问题,在 Android 的浏览器中运行此脚本。

<?php  
$host= "localhost"; //yout host name  
$username= "root";  //yout user name  
$password= "";      // your password  
$db_name= "qec";  // your database name  
$con=mysql_connect("$host", "$username", "$password")or die("cannot connect"); //mysql connection  
mysql_select_db("$db_name")or die("can not select DB"); //select your database 
error_reporting(E_ALL ^ E_NOTICE); 
$depart = $_POST['depart'];  
$degree = $_POST['degree'];  
$semester = $_POST['semester']; 
$study_year = $_POST['study_year'];
$faculty = $_POST['faculty'];



$query = "INSERT INTO p1 (depart,degree,semester,study_year,faculty) VALUES ('$depart', '$degree', '$semester', '$study_year', '$faculty')";  
mysql_query($query) or die('Query "' . $query . '" failed: ' . mysql_error());  
// name, email and address are fields of your fields; test your table. $name, $email and $address are values collected from the form  
?>  

它工作好在 PC 上但不是在 Android 的浏览器中。页面是在http://qec.890m.com/performa.html (提交 php 脚本)。

解决方法 1:

它看起来像链接标记您的提交按钮周围是的问题。

替换︰

<a href "thank.html"  > <input class=" btn-block btn-primary"   name="Submit" height="69" type="submit" ></a>

与︰

<input class=" btn-block btn-primary"   name="Submit" height="69" type="submit" >
赞助商