note 33675 added to function.eval

Ask a Question related to PHP Notes, Design and Development.

  1. #1

    Default note 33675 added to function.eval

    /*in database ho HTML e PHP
    mischiato ecco come ho risolto per far
    scrivere HTML e per ottenere il PHP interpretato.
    ciao

    $srt = il risultato della query
    */

    /*in a database i have a mix of HTML and PHP

    that's the way i get html and PHP

    $srt =result of a query

    ex:
    <table width="437" border="0" cellspacing="0" cellpadding="2" >
    <tr>
    <td width="213" bgcolor="#FFFFFF" align="center" class="text_blu">LOGO TIPO</td>
    <td width="232" class="text_small"><? echo $campo_array[XUIL104];?><br>
    <? echo $campo_array[XUIL104];?></td>
    </tr>
    </table>
    sorry for bad english
    */

    $x= strlen($str);
    $start=0;
    $end =0;
    for ($RR=0;$RR<=$x;$RR++){

    if($str[$RR] == "<" && $str[$RR+1] == "?") {
    $start = $RR + 2;
    }

    if($str[$RR] == "?" && $str[$RR+1] == ">") {

    $end = $RR ;
    $rrr = $end - $start;
    $php = str_replace("\"","'",substr($str, $start, $end - $start));
    eval($php);
    $start=0;
    $RR=$RR+2;
    }

    if(!$start){
    echo $str[$RR];
    }

    }
    ----
    Manual Page -- [url]http://www.php.net/manual/en/function.eval.php[/url]
    Edit Note -- [url]http://master.php.net/manage/user-notes.php?action=edit+33675[/url]
    Delete Note -- [url]http://master.php.net/manage/user-notes.php?action=delete+33675&report=yes[/url]
    Reject Note -- [url]http://master.php.net/manage/user-notes.php?action=reject+33675&report=yes[/url]

    paq@libero.it Guest

  2. Similar Questions and Discussions

    1. note 33827 added to function.function-exists
      This can be used to conditionally define a user function. In this sense, it can act as a sort of inline include_once(). For example, suppose you...
    2. note 33714 added to function.register-tick-function
      please can anyone help me to discover if this function can be used to make a chat ---- Manual Page --...
    3. note 33621 added to function.ftp-put
      Is there a way to not overwrite existing files? ---- Manual Page -- http://www.php.net/manual/en/function.ftp-put.php Edit Note --...
    4. note 33575 added to function.register-shutdown-function
      If your script exceeds the maximum execution time, and terminates thusly: Fatal error: Maximum execution time of 20 seconds exceeded in - on line...
    5. note 33558 added to function.eval
      mysql+eval=all website example : --------------------------------- table : id = 1 name = index.php code = echo "in the web site !, links,...
  3. #2

    Default note 33675 deleted from function.eval by alindeman

    Note Submitter: [email]paq@libero.it[/email]

    ----

    /*in database ho HTML e PHP
    mischiato ecco come ho risolto per far
    scrivere HTML e per ottenere il PHP interpretato.
    ciao

    $srt = il risultato della query
    */

    /*in a database i have a mix of HTML and PHP

    that's the way i get html and PHP

    $srt =result of a query

    ex:
    <table width="437" border="0" cellspacing="0" cellpadding="2" >
    <tr>
    <td width="213" bgcolor="#FFFFFF" align="center" class="text_blu">LOGO TIPO</td>
    <td width="232" class="text_small"><? echo $campo_array[XUIL104];?><br>
    <? echo $campo_array[XUIL104];?></td>
    </tr>
    </table>
    sorry for bad english
    */

    $x= strlen($str);
    $start=0;
    $end =0;
    for ($RR=0;$RR<=$x;$RR++){

    if($str[$RR] == "<" && $str[$RR+1] == "?") {
    $start = $RR + 2;
    }

    if($str[$RR] == "?" && $str[$RR+1] == ">") {

    $end = $RR ;
    $rrr = $end - $start;
    $php = str_replace("\"","'",substr($str, $start, $end - $start));
    eval($php);
    $start=0;
    $RR=$RR+2;
    }

    if(!$start){
    echo $str[$RR];
    }

    }
    alindeman@php.net Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139