I have a database driven website (dynamic pages) but the content is stored in static files that are included in my pages. I want to scrap these text files and put the content in a database table, but I don't know how to deal with PHP code in the content.
For example, consider the following text:
<p>You can learn more at <a href="<?php echo $MySite1; ?>">this website</a>.</p>
$MySite1 might echo <a href="wwww.mysite1.com">, but if I put it into a database table, it just displays as plain text.
So does anyone know how I could modify a query like the one below so that PHP code in content stored in field AI. Article will display as PHP code? In other words, I'd like visitors to see www.mysite1.com, not <?php echo $MySite1; ?>.
Thanks.
$Topics = mysql_fetch_assoc(mysql_query("SELECT ZT.N, ZT.URL, ZT.Title, ZT.Subtitle, ZT.Parent, ZT.Live, AI.URL, AI.Article
FROM gz_topics ZT
LEFT JOIN gz_articles_topics_intro AI ON AI.URL = ZT.URL
WHERE ZT.URL = '$MyURL' AND ZT.Live = 1"));
eval()but what you are going for is bad!