如何上传android和iso应用程序包含mysql / php和包装与phonegap

How to upload android and iso app containing mysql / php and wrap with phonegap

本文关键字:mysql php 包装 phonegap 包含 应用程序 android iso      更新时间:2023-09-26

我正试图使android和ios应用程序使用html, css和通过JSON php传递所有mysql,这样我就可以使用它与手机的差距。

我所有的功能在浏览器上测试时都在工作,但我如何才能将我的应用程序及其服务器端功能上传到github存储库,以便我可以使用手机gap云构建。当我开发没有mysql的应用程序时,我使用github仓库。

如果我要上传mysql到一个删除服务器和应用程序到github,我如何链接它。

下面是我的PHP连接到数据库

<?php
header('Access-Control-Allow-Origin: *');
$user="root";
$pass="xxxx";
$dbh = new PDO('mysql:host=localhost;dbname=uxxxmobile', $user, $pass);
?>

这是我的登录功能'

<script>
$(document).ready(function(){
    $('#loginForm').on('submit',function(e){
        var myForm = new FormData($(this)[0]);
        var host = 'http://example.com/uixxxmobile/connections';
        $.ajax({
            type:'POST',
            url: host + '/login.php',
            data : new FormData($(this)[0]),
            cache: false,
            contentType:false,
            processData: false,
            beforeSend: function(){
                $("div#divLoading").show();
            },
            success: function(response){
                $("div#divLoading").hide();
                console.log(response);
                if(response.success == true)
                {
                    window.location.href = "profile.html";
                }
                else if( response.success == false ){
                    alert('please enter a correct email & password');
                }
                else if(response.matric =="") {
                        alert('email is wrong');
                    }
                    else if(response.password==""){
                        alert('password is wrong');
                    }
            },
            error: function(data){
                alert('Login fail. Check your login details correctly');
                $("div#divLoading").hide();
            }
        });
    return false;
    });
});
</script>

和我的个人资料功能

<script>
$(document).ready(function(){
    var host = 'http://example.com/uixxxmobile/connections';
    $.ajax({
        type: 'GET',
        url: host + '/profile.php',
        data: 'param=no' ,
        dataType: 'JSON',
        success: function (response) {
            console.log(response);
            var input ="";
            input +='<b>' + response.name + '</b><br>';
            input += response.faculty + '<br>';
            input += response.dept + '<br>';
            input +=response.school + '<br>';
            var cumgrade= response.cumgpa;
            var currentgrade= response.currentgpa;
            $('#basicContent').html(input);
            $('#cumgpa').html(cumgrade);
            $('#currentgpa').html(currentgrade);
            $('#level').html(response.level + ' Level ' +response.semester+ ' Semester')

        },
        error: function (e){
            alert (e);
        }
    });
    $('#mycourses').load('connections/user-course.php');
});
</script>

通过ajax调用链接它。在我的应用程序中,我在jquery中使用ajax:

var host = 'your host address - ex: http://example.com/php/';
$.ajax({
    url: host + "/driverlogin.php",
    type: 'POST',
    cache: false,
    data: $('#frmdriverlogin').serialize(),
    success: function(arr) {//handle success}, error: function(){//handle error}   });