Ask a Question related to PHP Notes, Design and Development.
-
paq@libero.it #1
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
-
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... -
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 --... -
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 --... -
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... -
note 33558 added to function.eval
mysql+eval=all website example : --------------------------------- table : id = 1 name = index.php code = echo "in the web site !, links,... -
alindeman@php.net #2
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



Reply With Quote

