DarthHate Posted April 10, 2006 Share Posted April 10, 2006 Actually, I have a php page, that defines a template. Somewhere in there I have $head = <html> etc etc.So basically, $head defines what my front page looks like. The thing is, I want to insert some user statistics from my database on the front page. The database query is obviously easy. But how do I slip it in there? I started trying something then I realised I had no idea what i was even trying to do...Cheers Quote Link to comment Share on other sites More sharing options...
ober Posted April 10, 2006 Share Posted April 10, 2006 That's a little hard to grasp exactly what you're trying to do. Can you post some code? If it's just as simple as displaying HTML along with PHP, you can jump in and out of PHP code as much as you want. And you can store whatever you want to in a PHP variable if that's the problem. Quote Link to comment Share on other sites More sharing options...
DarthHate Posted April 10, 2006 Author Share Posted April 10, 2006 [code]<?include "../mysqlcon.php";$admin_info = mysql_fetch_assoc(mysql_query("SELECT * FROM bhost_admin"));$n = basename($_SERVER['PHP_SELF']);..(this is still php).elseif($page == "admin_broadcast.php") { $b19 = "<b>"; }$head = "<html><head><title>$admin_header1</title>..(this is html in a php variable).<center><br><img src='../images/bh.gif' border='0' style='margin-left: 6px;'></center>"[/code]on the last line, where img src is, i want to make table, and have the img on the center, an ad on the left and my php query on the right.Hope it's a bit more clear now, sry for the initial crappy explanation :) Quote Link to comment Share on other sites More sharing options...
DarthHate Posted April 12, 2006 Author Share Posted April 12, 2006 sorry to up this...but i've still not found a solution :(No-one has any ideas? Quote Link to comment Share on other sites More sharing options...
Paithar Posted April 12, 2006 Share Posted April 12, 2006 I'm curious. Is there a reason you're putting all of your html inside of a php variable? Like the other poster said, it's very easy to jump in and out of php and therefore have html code integrated there as well. Quote Link to comment Share on other sites More sharing options...
DarthHate Posted April 13, 2006 Author Share Posted April 13, 2006 no reason besides the fact that it's a script that was made this way :) Quote Link to comment Share on other sites More sharing options...
.josh Posted April 13, 2006 Share Posted April 13, 2006 am i missing something here? seems like all you would have to do is:[code]...$head = "<html><head><title>$admin_header1</title>..(this is html in a php variable)...<table><tr> <td> advertisement stuff </td> <td> <center> <br> <img src='../images/bh.gif' border='0' style='margin-left: 6px;'> </center>" </td> <td> database query stuff </td></tr></table>[/code]well it seems to me that's all you have to do? Quote Link to comment Share on other sites More sharing options...
Paithar Posted April 13, 2006 Share Posted April 13, 2006 So is this php variable with all of the html in it going to be displayed later in the script? I guess I'm just not seeing why anyone would want to put all of the html inside of a variable. Maybe if I new more about what you're trying to do with the whole page, I or someone else on here could come up with a better solution to your problem. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.