To connect PHP and Ionic app


#1

How to connect ionic app to PHP script, using Mysql DB.

<form action="" method="">
Names:<input type="text"  >
Username:<input type="text" >
Password:<input type="text">
<button type="submit" name="submit" value="Send">
</form>

<?php
sessions_start();
include"db.php";
if (isset($_POST['submit'])) {
	$names = $_POST['names'];
	$username=$_POST['username'];
	$email = $_POST['email'];
	$pass = md5($_POST['pass']);
	$query= mysql_query("INSERT INTO users(names,username,  password) VALUES ('$names','$username', , '$pass')");
    if($query){
		echo "Data successfully Inserted";
		header("Refresh: 2 ; url=register.php");
	} else {
		die(mysql_error());
    }
}
?>

How to use this code, because i’m running php on local serve. but ionic app is not. Thanks