In my following socket server, I am trying to listen to a connection through port 12345 in my web browser. http://127.0.0.1:12345/
I assumed that the following would detect that something was trying to connect to the port through the browser, using socket_create_listen(). I don't know if I am doing something wrong or just not understanding what socket_create_listen() is doing.
Does anyone know why when going to the address, my socket server isn't detecting the connection?
Note: The client is supposed to be the web browser, not another php file.
Here is my server class:
Code: [Select]<?php
set_time_limit(0);
class Pherver{
private $setup;
public $server;
public $connections;
function __construct(){
$this->setup = parse_ini_file("config.ini", TRUE);
$this->server = socket_create_listen($setup['server']['port'], $etup['server']['connections']);
socket_listen($this->server);
}
function start(){
while($client = socket_accept($this->server)){
socket_write($client, "hello");
print "here";
}
}
}
?>
Here is how I start the server:
Code: [Select]<?php
include 'Pherver.php';
$server = new Pherver();
$server->start();
?>
Thank you
Displaying returned XML in another PHP page
I have an online payment form that will return XML given if a payment is successful or declines. I am using PHP cURL to do this, and it all works from the standpoint of approving or denying
How to create a static html menu from a database
Hi,I have built a small cms which allows me to create simple html pages and then upload them to an ftp.Everything is working apart from the menu, I cant get my head round how to create the menu
SCO Unix
I know this might not be the place to ask, but, can anyone tell me if SCO Unix comes with PHP built in??
Images in email problem
I found this script for sending emails, it works but if the email has <img src="image.jpg"/> it will send this &lt;img src="image.jpg"&gt;
Multidimensional $_POST
HelloHow to get a single array from array of array (2 - dimension).For example I have a form:Line number On/Off | Expand/Contract <input type="text"
Vertical Alligning - Not working in 1 cell?
<?phpecho "<table id=\"valign\" width=\"60%\" style=\"border:1px solid #EEE;\">";echo "<tr><td
how do i display data on a page from mysql
1 - do i use this code at the top of each of my page i wish to only alow access if there as been a sessionCode: <?phpinclude_once 'Connect.php';if (!is_authed()) { die ('You are not
Firewall / visited websites logger
Hi.
Find only certain URLs from page ... regex (semi-complete script)
Hi guys,What I need to do is take a page & extract all the URLs from the page & place them in an array.However I only need to grab certain
How to write on database when a link is clicked?
Hi,