Earlier I had a post about my Socket Server, I wasn't able to get it to connect, now I can
I am using socket_write() to well hopefully send html to a web page, the problem I think is that I have to send Response Headers, but I am not sure how to do that. Is that what I need to do? Currently the page just sits there and loads, it connects to the sockets, but nothing ever shows up on the page, so that is why I think I also have to send response headers... Is that correct?
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($this->setup['server']['port'], $this->setup['server']['connections']);
if(!$this->server){
echo socket_last_error();
}
if(!socket_listen($this->server)){
echo socket_last_error();
}
echo "Pherver Service Started!n";
echo "Listening on port: ".$this->setup['server']['port']."n";
}
function start(){
while(TRUE){
$client = socket_accept($this->server);
if(!$client){
echo socket_last_error();
}else{
$msg = "<html><body><h1>Hello</h1></body></html>";
socket_write($client, $msg);
}
}
}
}
?>
losing variables between php brackets
Hihave got this code:Code:
Multi-user card game
I'm writing a batch of games and such. Lottery is finished, Poker,blackjack,etc are next. They will be multi-user. I've got the multi-deck shoe and dealing table done and other parts rough coded. What
help connecting a form to php and then emailing the form
Ok. So, I made a form, and I need help to where when submitted, I get an email with the submitted details. I have attached all the files you might need. The email should look like the 'Email.html'
urldecode question
How would I format this line of code properly?<?php echo urldecode($_GET['Title']); ?>
BAPI BBP_INB_DELIVERY_CREATE - material number missing in delivery
Hi Experts,
How do I use ValidatorCallout extender in Login control?
Hi,I'd like to customize the look and feel of the login control a little bit. One thing I'd love to do is to use the ValidatorCallout extender in AJAX controls toolkit so that I can display nicer
Allowing ' and "
Hello everyone,I am creating a form where users submit information to go into a database. I want the users to be allowed to use both ' and " in their messages, but the problem is when I try to
Using Windows message as a Handle
Hi,
quick question
Hi ..i have a questionhow do i set a var so it displays via an echoCode: $logo = '<img src="Images/tvguide/sabc1.jpg">';echo '<div
Placing and array within an array then sorting it!
I have a page that runs two large mysql queries and saves the results into arrays, in php I then perform a simple multiplication between the two arrays and the results is displayed in a dynamic html