Hey, I don't really know how to word this, but I'll try my best.
I was wondering if I could execute PHP from a non PHP page, or MySQL database.
Example 1:
index.php
PHP Code:
<?php
$hello = "Hey,";
include("text.html");
?>
text.html
PHP Code:
{$hello} I'm RastaLulz!
Result (example 1):
PHP Code:
Hey, I'm RastaLulz!
Example 2:
index.php
PHP Code:
<?php
include("config.php");
$name = "RastaLulz";
$id = $_GET['id'];
$query = mysql_query("SELECT * FROM pages WHERE `id` = '$id'");
$array = mysql_fetch_array($query);
$text = $array['text'];
echo $text;
?>
MySQL - text
PHP Code:
Hey, my name is {$name}!
Result:
PHP Code:
Hey, my name is RastaLulz!
If anyone could help me with this, it'd help a lot (if it makes any sense)!