I'm trying to include a php file inside another php file, but it is not working and I don't know why.
Moreover, I'm getting no erroes. allow_url_include
is enabled in php.ini file.
I'm using XAMPP server.
Below here is part of my code:
q.php
<div class="article">
<? php
include ('a.php');
?>
</div>
where a.php simply has echo statement:
echo "hello";
I'm posting bigger section of my code now.
<div class="artical">
<?php
$username = "root";
$password = "";
$database = "techinsight";
$server = "127.0.0.1";
$db_handle = mysql_connect($server, $username, $password);
$db_found = mysql_select_db($database, $db_handle);
if ($db_found)
{
$SQL = "SELECT * from questions";
$result = mysql_query($SQL);
while($db_field=mysql_fetch_assoc($result))
{
$x = $db_field['Qid'];
while($x==1 && $x==NULL)
{
$SQL = "SELECT * from questions";
$result = mysql_query($SQL);
$db_field = mysql_fetch_assoc($result);
$x = $db_field['Qid'];
}
}
if($x==$x)
{
for($x; $x>0; $x--)
{
$SQL = "SELECT * from questions WHERE Qid=$x";
$result = mysql_query($SQL);
$db_field = mysql_fetch_assoc($result);
$str_que = $db_field['question'];
echo "<div class='dabba'>
<div class='block_a'> <?php include('a.php'); ?> //here it is.
</div> <br>
<div class='block_b'>
it is 2nd section. <br>
</div><br>
<div class='block_c'>
last one.<br> </div>
</div> <br><br>";
}
}
}
?>
</div>