Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I want to create a real time notification system for my website(social network)
I'm using laravel 5.2,
I am using socket.io and redis currently,
I have created notifevent and broadcasted it succesfully, but no idea what to do ahead, can anyone please help me with it or guide me.
You should have a NodeJS and socket.io, install it on your server
When have event, use Redis to hold your variable and send it to your NodeJs or Use this PHP Library, you can send variable from PHP to NodeJS Server: http://elephant.io/
Data Processing on the NodeJs
Return it to PHP Webpage use Socket.io (client javascript) to catch this event and display for end-user (using emit and on)
You can follow this instruction with elephant.io: Using PHP with Socket.io
or that with Redis: https://github.com/laracasts/Laravel-Redis-and-Socket.io
You should try two ways and feedback with new question if you stuck because your question is unclear and very hard to answer
You can use javascript send Ajax Request and get variable from PHP and use this variable to make a socket.emit but this way is less security, you must use token or anything like this if you want to public your website
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I've been learning how to use React and I already know substantial PHP. I know that I can use PHP with React since React is only the view in MVC but how do I use PHP with react locally. I have a lamp server running on my Linux machine I want to be able to run it as a backend. Like, let's say I want to make a login screen how do I connect it up. I make the front end in React and the backend in PHP. Do I have to use CORS I'd rather not since, in the end, it's going to be running on the same server.
You don't need CORS, it seems you are looking for proxy.
Just set your proxy to the listening port of your LAMP API server and then simply use fetch with absolute path from your React app.
Let's say your LAPM server is listening on port 23000
"proxy": "http://localhost:23000",
in package.json file of your React app, then
fetch("/my/api")
will call http://localhost:23000/my/api.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have already created a website with a mysql database. Now, I am attempting to create an IOS app that will connect to the same database that my website "talks to". All of the tutorials I have seen have relied exclusively upon PHP and have walked through the process of creating the database. My website was not written with PHP, so I am completely lost on how I get PHP to help me in this case. I'm new to all this, so I am not sure what information is helpful, but so you know:
The website templates were written in HTML and CSS,
views page (functionality) written in python,
Flask is the microframework, and
pymysql is the ORM
Any pointers in the right direction would be much appreciated.
If you are using Flask then this is how you need to go through - there are other ways, but I would go for this -
Install Flask REST API to expose rest api from your site. You can get the documentation here - http://www.flaskapi.org/
Expose required API's from your website using flash rest api
Consume those API's with your mobile application.
NOTE: Don't ever expose your database directly to client side. BAD IDEA. Always use a middleware, could be php, python, .net - does not matter what it is.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I am new to android and I have some questions related to the data storage technique for my app. I am creating an app (like splitwise) where multiple users can insert and update their data and can see others data as well.
I read about the techniques that android provides like :
Shared Preferences
Internal Storage
External Storage
SQLite Databases
Network Connection
After researching I came to a conclusion that I have to create a database on web server and use php scripts to access that data.
Questions :
- Is this the only way to save data on-line using web server and php
scripts ?
- Do I need to create local database using SqlLite also to store data
when the app is running to avoid multiple calls to web ?
You must be searching for REST API. Please take a look # Andoid-PHP Samples/ tutorial
You can use services like Firebase or Google's Clouds Endpoints to simplify the creation of your backend
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I'm planning to make a website in PHP. At some point in future I might need to create an Android application for my website. Now I know that Android is Java based, so my question is will I be able to communicate with my application i.e. sending and receiving data from my server on which my PHP website is running and how?
The best way is to generate JSON objects using your php scripts then using JSON parser in your android app to use those objects.
Using this you easily send and receive data without having to change php scripts. You can also follow this link :
http://www.androidhive.info/2012/05/how-to-connect-android-with-php-mysql/
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I've made an android app that let you save some data locally (for example: photos). Now i would like to create a web service that will automatically backup the data and later let the user to check them on a web application (eventually coded with PHP).
I know PHP for server side, and some python. Should i create a Rest-full api with php using a cms like described here or should i use Google Cloud Platform? Which is more convenient?
The application should:
Authenticate the user,
Automatically backup the data,
Let the user
access the data on a web application
Personally I find Parse to be really useful, powerful and affordable. In the scope of developing apps for local businesses we still haven't paid a dime and it has saved us a ton of development time. www.parse.com