PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
$msgToUser =
"
<div style=\"float:left\">
<br /><br /><h3><font color=\"#00a651\"><strong>Your account has been activated. <br /><br />
You are ready to log in and began your swap process.</strong></font></h3>
If you need more help about the swap process, take a look at <a href=\"http://www.areeban.com/howitwork.php\">how it work</a> page.
</div>
<div>
hello
<?php include_once \"includes/side/search.php\";?>
</div>
";
I want to include the search.php as you can see from the code above, I used this <?php include_once \"includes/side/search.php\";?> to include it but it is out putting it blank.
<?php
$msgToUser =
"
<div style=\"float:left\">
<br /><br /><h3><font color=\"#00a651\"><strong>Your account has been activated. <br /><br />
You are ready to log in and began your swap process.</strong></font></h3>
If you need more help about the swap process, take a look at <a href=\"http://www.areeban.com/howitwork.php\">how it work</a> page.
</div>
<div>
<?php include_once "includes/side/search.php";?>
</div>
";
?>
if I run includes/side/search.php any where outside this php code it work fine,
I am using the full path now which is http://areeban.com/includes/side/search.php if you take a look it work fine.
<?php
ob_start();
include_once "includes/side/search.php";
$search = ob_get_clean();
$msgToUser =
"
<div style=\"float:left\">
<br /><br /><h3><font color=\"#00a651\"><strong>Your account has been activated. <br /><br />
You are ready to log in and began your swap process.</strong></font></h3>
If you need more help about the swap process, take a look at <a href=\"http://www.areeban.com/howitwork.php\">how it work</a> page.
</div>
<div>
$search
</div>
";
?>
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Well, I am assuming that the included file is echoing data. ob_start() starts an output buffer that buffers the output of the include. You then assign that output to a variable and end and clear the buffer. So nothing is outputted but it is assigned to the variable that you can use later.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.