Comments (10)
I aso wants to perform this task.
any idea?
from phpwebsocket-chat.
i implemented this task but not sure it is secure or not .. :p
if you want to check then server side file is https://github.com/manojdhiman/yii-login-register-with-chat/tree/master/chat_server
and client side https://github.com/manojdhiman/yii-login-register-with-chat/blob/master/themes/basic/views/layouts/main.php
please check this is just a try if you can improve this
from phpwebsocket-chat.
hiii..manoj
I have created function in Server.php
function getServerData(){
$sql = "SELECT id, user_name FROM user_master";
$result = mysqli_num_rows($conn, $sql);
if ($result->num_rows(result) > 0) {
while($row = mysqli_fetch_assoc($result)) {
$d = "id: " . $row["id"]. " - UName: " . $row["user_name"]. "<br>";die;
}
}else{
$d = "0 results";
}
return $d;
}
which is called when client == 1
if ( sizeof($Server->wsClients) == 1 ){
echo getServerData();
$Server->wsSend($clientID, "It's server!!");
}
when i refresh connection becomes diconnect, and it returns nothing.
Is there any prob?.
I wants to send data instead of message.
Thanks .
Jignesh
from phpwebsocket-chat.
it should reconnect if you refresh the page .check your terminal after refresh the page with print something on close event like
function wsOnClose($clientID, $status) {
global $Server;
$ip = long2ip( $Server->wsClients[$clientID][6] );
$Server->log( "$ip ($clientID) has disconnected." );
}
from phpwebsocket-chat.
Hii,Manoj
I have done server response sucessfully.
One issue is when i try sending data from server as a video file it crashes my cmd,
and it's not responding.
Is it any way to send video from server side to the client?
Thank you,
Jignesh.
from phpwebsocket-chat.
Hi,
I use websocket, but i wanna send msg to 1 person, not to all,
can u help me ?
from phpwebsocket-chat.
Hi,
I use websocket, but i wanna send msg to 1 person, not to all,
can u help me ?
And not only that, i'm trying to hide the message if anyone connect to that websocket, only show the message to the person i want
from phpwebsocket-chat.
Hi,
I use websocket, but i wanna send msg to 1 person, not to all,
can u help me ?And not only that, i'm trying to hide the message if anyone connect to that websocket, only show the message to the person i want
This was for 2 years ago.
I fixed it !
from phpwebsocket-chat.
Hi,
I use websocket, but i wanna send msg to 1 person, not to all,
can u help me ?And not only that, i'm trying to hide the message if anyone connect to that websocket, only show the message to the person i want
This was for 2 years ago.
I fixed it !
Oh, sorry, i found this project and using it to develop a chat system , and i'm stuck in the same case.
from phpwebsocket-chat.
Hi,
I use websocket, but i wanna send msg to 1 person, not to all,
can u help me ?And not only that, i'm trying to hide the message if anyone connect to that websocket, only show the message to the person i want
This was for 2 years ago.
I fixed it !Oh, sorry, i found this project and using it to develop a chat system , and i'm stuck in the same case.
You should use node js for that.
PHP socket is not good for socket programming.
from phpwebsocket-chat.
Related Issues (20)
- command prompt error. HOT 2
- How can we run server when we transfer file from local to server like (bluehost.com , godaddy.com)
- Whats the license? HOT 3
- Sessions / Cookies not working HOT 1
- Send data from other server file (php) to users HOT 1
- Set Global HOT 1
- Socket_create() Missing PHP 5 HOT 2
- wss error HOT 2
- send foreach data to client
- All browser canβt establish a connection to the server at wss://
- No works in one tab! HOT 2
- how to create a room for users HOT 2
- How to close the server? HOT 1
- Is this working in Android application
- deleted
- channel / rooms / groupchannels HOT 1
- Sessions not set
- Remote connection not stable
- wss support HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phpwebsocket-chat.