0

I have a.php where I do a DB query and assign that to list like this..

list($A,$B)=mysql_fetch_row(mysql_query("SELECT A,B FROM configs WHERE idone=$v AND id='$inputid' LIMIT 1"));

            $p=array();
            $p=@explode(';,',base64_decode($A));
            $bg=$p[0];
            $A='';

            $i=0;
            foreach($p as $X){
                if(++$i>1) $A.='\''.str_replace(':-',':',$X).'\',';
            }

require'templates/inner_play.htm';

Now in inner_play.htm , I am using $A and $B from then above list like this..

 'image': '<?php echo $A?>',
 'URL' : '<?php echo $B ?>'

I can get the values for $A but $B does not resolve.? am i missing anything.?

Note: I can;t change the inner_play.htm to php as its part of bigger template system and I do get the value for $A in the same Htm but for some reason I am not getting $B.

2

4 Answers 4

2

Rename inner_play.htm to inner_play.php.

Sign up to request clarification or add additional context in comments.

Comments

1

You are missing that .html files can not execute PHP functions sucha as echo.

You should rename your inner_play.htm to inner_play.php if you want to use any PHP inside.

1 Comment

I don;t think that's true .. as I am getting the data for $A in the same htm . its the $B which doesn't get resolved in htm file
0

change the extention to .php or .phtml simple htm extension can't understand the php code
Valid extension for php code are php and phtml

Comments

0

Or you can setup server to run html as php:

Create a .htaccess file at the root of your website and add this line:

AddType application/x-httpd-php .html .htm

2 Comments

Thanks, I think that's already setup. that's how i get the value for $A in htm file, its the $B which is causing problem
maybe $B just contains NULL or False. in this case you'll not see it. do var_dump($B).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.