[PHP] goto

2002-06-13 Thread Stephen Brewster

I am wirting a code seperation engine for PHP, the idea of which is it will
remove the need for me to have to build the majority of the websites at my
company. The designers will be able to build the html in dreamweaver or
similar and then insert custom tags into their code. The engine will parse
the code and insert the necessary PHP code. For the most part this engine is
working. However under some cirtumstances (like the one shown below) I need
to be able to perfom a loop or if statement. This is proving to be
incredably difficult since I would end up with code like below. For obvious
reasons the compiler does not like this code. This would be simple if PHP
had GOTO's. Does anyone know of a way around this situation?

HTML


   
   
  
  
   
   



PHP
---

if($type == 'LOOP') {
   $sql = 'SELECT * FROM products';
   $result = mysql_query($sql, $db);
   $record = $mysql_fetch_array($result, MYSQL_ASSOC);
   {
}

if($type == 'TEXT')
   echo($record[$field]);

if($type == 'ENDLOOP') {
   }
}

--

------
Stephen Brewster
Email: [EMAIL PROTECTED]
Tel: 0116 2335545
Mobile: 07776 475849
ICQ: 383095
--

UNIX SEX
unzip; strip; touch; finger; mount; fsck; more; yes; umount; sleep




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Help with sockets

2002-07-19 Thread Stephen Brewster

1) you use whats called an "Itterative Server Model". That is to say you
create an list of all the sockets you are using and pass them to
"socket_select" (http://www.php.net/manual/en/function.socket-select.php)
and it will tell you which ones are ready to be read from, which can be
written to and which have exceptions.

2) I am not too sure what you mean here but using the select you can find
out which socket have info in their buffers and then read it so there will
be no blocking on I/O

--
----------
Stephen Brewster
Email: [EMAIL PROTECTED]
Tel: 0116 2335545
Mobile: 07776 475849
ICQ: 383095
--

UNIX SEX
unzip; strip; touch; finger; mount; fsck; more; yes; umount; sleep

"Jeremy" <[EMAIL PROTECTED]> wrote in message
004401c22edc$a848a090$0202a8c0@L5">news:004401c22edc$a848a090$0202a8c0@L5...
> How can I do the following with PHP?
>
> 1) Accept more than 1 connections without forking
> 2) socket_read and fgets from 2 connections at the same time
>
> please help!
> thanks in advance
>
>
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php