Click here to Skip to main content
15,885,885 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am creating android app of my website.I want to know which changes are necessary to make in my php files in order to connect my android app to my website's database as these files have no echo statement or I have to make another php files for these purpose.Please help as I am new to android.
My first file is login.php
XML
<?php require_once('Connection/cnn.php'); ?>
<?php
session_start();
if((isset($_POST['admin_login'])) && ($_POST['admin_login']=="form99"))
{
$_SESSION['username']=$_POST['txt_email'];
$_SESSION['password']=$_POST['txt_password'];
header('Location: login-pass.php');
}
if($_SESSION['verified']=='Y')
{
    header('Location: transporter-account.php');
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Transporteazy</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/main.js"></script>
</head>

<body>

<!-- MAIN BODY WRAPPER START -->
<div id="main-Body-Wrapper">

<!-- HEADER PART START -->
<div id="header-con">
    <?php include ('header.php'); ?>
</div>
<!-- HEADER PART END -->





<!-- MIDDLE PART START -->
<div class="how-it-work">
    <div class="left-part">
    <?php if($_GET['msg']=='error') {?>
<h1>Please login below to see posted loads or <a href="transporter-registration.php" target="_self">click here</a> to register with us.</h1>
<?php } else {?>
<h1>Login Area</h1>
<?php } ?>
            <div class="login">
            <?php $page=$_SERVER['QUERY_STRING'];
        if ($page!="") {        ?>
        <div class="error">
        <?php if ($_GET['error']=="empty") { ?>
        <p class="alert">Please enter user name & password.</p>
        <?php } else if ($_GET['error']=="name") {?>
        <p class="alert">Please enter user name.</p>
        <?php } else if ($_GET['error']=="pass") {?>
        <p class="alert">Please enter password.</p>
        <?php } else if ($_GET['error']=="nouser") {?>
        <p class="alert">Something is wrong.</p>
        <?php } else if ($_GET['error']=="pend") {?>
        <p class="alert">You are not a authorize person to access further pages.</p>
        <?php }?>
        </div>
        <?php }?>
                <h3>If you are already registered, please login here.</h3>
                <div class="loginBox">
                    <form name="login-form" id="login-form" method="post">
                    <table width="420" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td width="150" align="right" valign="middle">Email Address :</td>
                        <td align="left" valign="top"><input name="txt_email" type="email" class="input" id="txt_email" value="" required placeholder="abc@xyz.com"/></td>
                      </tr>
                      <tr>
                        <td align="right" valign="middle">Password:</td>
                        <td align="left" valign="top"><input name="txt_password" type="password" class="input" id="txt_password" value="" required placeholder="*********"/></td>
                      </tr>
                      <tr>
                        <td align="right" valign="middle">&nbsp;</td>
                        <td align="left" valign="top"><input name="Submit" type="submit" class="loginBtn" value="" />
                        <input type="hidden" name="admin_login" value="form99"/></td>
                      </tr>
                      <tr>
                        <td align="right" valign="top">&nbsp;</td>
                        <td align="left" valign="top">&nbsp;</td>
                      </tr>
                      <tr>
                        <td align="right" valign="top">&nbsp;</td>
                        <td align="left" valign="top"><a href="forgot-password.php" target="_self">Forgot Password?</a>  <font color="#FF0000">|</font> <a href="transporter-registration.php" target="_self">Register here</a></td>
                      </tr>
                    </table>
                    </form>
        </div>
      </div>
    </div>




    <!-- RIGHT PART -->
        <div class="right-part">

                <?php include('benefits.php');?>

        </div>
    <!-- RIGHT PART -->


</div>
<!-- MIDDLE PART END -->




<!-- FOOTER PART STRAT -->
    <div class="footerCon">
        <?php include ('footer.php'); ?>
    </div>
    <!-- FOOTER PART END -->


</div>
<!-- MAIN BODY WRAPPER END -->
</body>
</html>
Posted
Updated 9-Apr-15 18:07pm
v2

1 solution

Lots of Android articles at http://www.codeproject.com/KB/android/[^] which will help you get started.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900