maybe switch() would be of some use?  Your could save the values for $type
in an array and look them up to get a numbe to use with switch(). You can
also have a "case else" with switch.


"Stephen Brewster" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> 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
> ----
> <table>
>    <products type="loop">
>    <tr>
>       <td><products type="text" field="name"></td>
>       <td><products type="text" field="price"></td>
>    </tr>
>    <products type="endloop">
> </tr>
>
>
> 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

Reply via email to