Unstoppable Domains — Get your daily AI drops report

[Resolved] Executing HTML-PHP code from variables

SpaceshipSpaceship
Watch

mignolo

Established Member
Impact
10
Executing HTML-PHP code from variables

The problem is:
I have html-php codes stored in mysql as strings... I query mysql and i obtain some variables like these:

$str_phpcode1 = "<div><?php echo "Hello world"; ?></div>";
$str_phpcode2 = "<span><?php func_loan(); ?></span>";
...

Obviously if I write
echo $str_phpcode1; or echo $str_phpcode2;
the strings will be printed as text and the "echo" and "func_loan()" are not executed as php code.

Is there a solution?
Thank you

Resolved:

eval("?>".$str_phpcode1."<?php ");
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
Appraise.net

We're social

Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back