2

I am trying to create an OTP android application. For doing the same, I have created a wampserver with phpmyadmin. I have been trying the access my local server with my android application but I am not able to connect. I tried using POSTMAN extension, the server works fine. For sending message I have integrated with website MSG91.

Here is my config.php

<?php
/**
 * Database configuration
 */
define('DB_USERNAME', 'root');
define('DB_PASSWORD', '');
define('DB_HOST', 'localhost');
define('DB_NAME', 'android_sms');


/**
 * MSG91 configuration
 */
define('MSG91_AUTH_KEY', "105265ALB2xj3uLr856c50090");
// sender id should 6 character long
define('MSG91_SENDER_ID', 'ANHIVE');

define('USER_CREATED_SUCCESSFULLY', 0);
define('USER_CREATE_FAILED', 1);
define('USER_ALREADY_EXISTED', 2);
?>

In my application I am trying to send name, email & mobile details to server which in turn sends an OTP to the mentioned mobile number. I am accessing the server in mobile using **

http://192.168.0.100/android_sms/request_sms.php

where following is my Ip address and request_sms.php is the file for sms request. While I worked with POSTMAN extension, I am able to send email,name and mobile to the same server.

I am confused at the moment about what should I do next to solve the issue. I am stuck with something silly and I would be deeply obliged if anyone could help me with the issue.

Steve Vinoski
  • 19,847
  • 3
  • 31
  • 46
Thomas k
  • 129
  • 1
  • 11
  • Is your mobile and the server pc connected to same network? Try accessing the URL from your phone's browser. What do you get there? – Prerak Sola Mar 10 '16 at 09:10
  • No, I have been using different networks for both the server pc and mobile. I tried URL in the browser, it shows webpage not available. – Thomas k Mar 10 '16 at 09:12
  • 1
    They should be in the same network. Currently your wamp server has no public ip to access from any network. – Prerak Sola Mar 10 '16 at 09:15
  • 1
    To make it accessible from the external network, read this: http://www.simonewebdesign.it/how-to-put-online-your-wampserver/ – Prerak Sola Mar 10 '16 at 09:20
  • Thanks a lot. If i intend to have different network for both, then is ther a way for accessing my server? – Thomas k Mar 10 '16 at 09:20
  • 1
    Host your application on public servers provided by Amazon, Google, etc or read the link I gave above. – Prerak Sola Mar 10 '16 at 09:22
  • Thanks a lot for the help. I tried the link u provided. Unfortunately, when i am trying to access the public ip with the port, I am still getting webpage not available. Can u suggest me what should i do next? – Thomas k Mar 10 '16 at 09:59
  • Did you mean to use the `one-time-password` tag instead of `otp` which is about Erlang? – Isaac Bennetch Mar 13 '16 at 00:39

1 Answers1

0

This is working on windows, linux, os servers

In the basic configuration of XAMPP, phpMyAdmin is accessible only from the same host that XAMPP is running on, at http://127.0.0.1 or http://localhost.

To enable remote access to phpMyAdmin, follow these steps:

Edit the apache\conf\extra\httpd-xampp.conf file in your XAMPP installation directory. Within this file, find the line below and update it to remove 'phpmyadmin' from the list of locations.

<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">

Restart the Apache server using the XAMPP control panel.

Abdellah Chadidi
  • 665
  • 2
  • 9
  • 23
  • I appreciate your help. I am trying to edit the file. Unfortunately, in my Wamp/bin/apache/conf/extra folder I dont have a httpd-xampp.conf file. Can you suggest the alternative? – Thomas k Mar 10 '16 at 09:10
  • try this solution http://stackoverflow.com/questions/8366976/wamp-error-forbidden-you-dont-have-permission-to-access-phpmyadmin-on-this-s – Abdellah Chadidi Mar 10 '16 at 13:05
  • Thanks for the help. But i am still unable to access the server with public ip. – Thomas k Mar 11 '16 at 07:29