I have code that fills variables for replacement into the contents of a .tpl file,
and then echoes the result.
Here's the code that determines the $p1 value:
<?php
...
$myinfo = mysql_fetch_assoc($result);
// fetch the 1st prospect
if ($myinfo["filler1"] == NULL) {
$p1 = $myinfo["fname"]." ".$myinfo["lname"];
} else {
$p1 = $myinfo["filler1"];
}
$p2 = "2";
$p3 = "3";
...
$tmp = @file_get_contents("file_x.tpl");
$tmp = str_replace(array("%%p1%%","%%p2%%",...), array($p1, $p2, ... ), tmp);
echo $tmp;
?>
Were I to hardcode $p1 = "xyz";, then the $p1 value would display.
But by deriving its value from the mysql_fetch_assoc function,
the value remains blank.
Any help would be appreciated.
and then echoes the result.
Here's the code that determines the $p1 value:
<?php
...
$myinfo = mysql_fetch_assoc($result);
// fetch the 1st prospect
if ($myinfo["filler1"] == NULL) {
$p1 = $myinfo["fname"]." ".$myinfo["lname"];
} else {
$p1 = $myinfo["filler1"];
}
$p2 = "2";
$p3 = "3";
...
$tmp = @file_get_contents("file_x.tpl");
$tmp = str_replace(array("%%p1%%","%%p2%%",...), array($p1, $p2, ... ), tmp);
echo $tmp;
?>
Were I to hardcode $p1 = "xyz";, then the $p1 value would display.
But by deriving its value from the mysql_fetch_assoc function,
the value remains blank.
Any help would be appreciated.