Forum Moderators: coopster
i've been at this for days, help would be appreciated.
the following piece of code is a new page i'm trying to add to a back office menu link. i'm using the include() function to call an HTML file.
i've tested many variations of this & the include function output will only appear ABOVE my header, not in the BODY (content) of the page. i've done all within my knowledge to fix/force it to appear in the body of the page, but it either won't show or produces an error.
not sure what i'm missing or even if i can add something to the css to correct the positioning. thanks in advance.
<?php
.........(600 pages)...............
elseif($action=="promotools"){
# =========================
# Show Promotion Tools
# =========================
$folder = str_replace("dashboard.php", "", $_SERVER["PHP_SELF"]);
$title = "Promo Tools";
$body = "
$menu <p align=center> Your Unique Referral Link Is: <input type=text size=50
value='http://$sys_domain$folder?affid=$user[id]'> </p>"; include("emotools.htm");
showPage($title, $body);
exit;
}
...
$body = "$menu <p align=center> Your Unique Referral Link Is: <input type=text size=50
value='http://$sys_domain$folder?affid=$user[id]'> </p>";
ob_start();
include('emotools.html');
/* echoes the html like it did before, but this time into output buffer, instead of blurting it out before showPage() function call */
$body .= ob_get_contents(); /* add the buffer to your body */
ob_end_clean();
showPage($title,$body);
...
blang, thank you for responding, followed your suggestions but - no go, results as follows:
- inserted before $body variable (no change - stills appears above header, outside of function)
- inserted before/after $folder variable (same response)
- inserted as 1st command in $body variable function(produced Parse error syntax error, unexpected T_STRING)
the thing is when i tried to include it in the $body function (which is where it should go, it produced an error).
Jsyvanne YOU ROCK! your suggestion is what did it, your instructions were clear & to the point (much thanks for that). results as follows:
- inserted your output buffer, as follows (without comments),
______________
$body = "$menu <p align=center> Your Unique Referral Link Is: <input type=text size=50
value='http://$sys_domain$folder?affid=$user[id]'> </p>";
ob_start();
include('emotools.htm');
$body .= ob_get_contents(); ob_end_clean();
showPage($title, $body);
_______________
AND THE CLOUDS PARTED! LOL!
much appreciation to you both,
mic