desithugg Posted May 12, 2007 Share Posted May 12, 2007 Umm I have a php function for a tab menu <? function tabarea() { print(" <div class='tabArea'> <a href='?do=page&action=main' class='tab'>Home</a> <a href='?do=page&action=rpg' class='tab'>RPG</a> <a href='index.php' class='tab'>Forums</a> <a href='do=page&action=chatroom' class='tab'>Chatroom</a> </div> "); } echo" <head> <link rel='stylesheet' type='text/css' href='http://7thsky.7t.funpic.org/rpg/Themes/default/style.css?fin11' /> <style> .abody { background-image: url(http://7thsky.7t.funpic.org/rpg/images/banner.png); } body { background-image: url(http://7thsky.7t.funpic.org/rpg/images/background.png); } </style> </head> <body> <body valign='top'> <div class='abody'> ".tabarea()." <div class='body'> <table width='100%' cellspacing='0' cellpadding='0'><tr> <td class='leftmenu' valign='top' rowspan='2'> left menu here </td></tr> </table> </div> "; ?> Um the problem is that instead of the menu showing up between <div class='abody'> ".tabarea()." <div class='body'> it shows up at the very top of the page I tried changing the print to echo and stuff but it didn't work. Here's the page source of how it shows up <div class='tabArea'> <a href='?do=page&action=main' class='tab'>Home</a> <a href='?do=page&action=rpg' class='tab'>RPG</a> <a href='index.php' class='tab'>Forums</a> <a href='do=page&action=chatroom' class='tab'>Chatroom</a> </div> <head> <link rel='stylesheet' type='text/css' href='http://7thsky.7t.funpic.org/rpg/Themes/default/style.css?fin11' /> <style> .abody { background-image: url(http://7thsky.7t.funpic.org/rpg/images/banner.png); } body { background-image: url(http://7thsky.7t.funpic.org/rpg/images/background.png); } </style> </head> <body> <body valign='top'> <div class='abody'> <div class='body'> <table width='100%' cellspacing='0' cellpadding='0'><tr> <td class='leftmenu' valign='top' rowspan='2'> left menu here </td></tr> </table> </div> Any idea's how i can get it to show up where i execute the function? Quote Link to comment https://forums.phpfreaks.com/topic/51097-solved-php-function-problem/ Share on other sites More sharing options...
Trium918 Posted May 12, 2007 Share Posted May 12, 2007 Try this! You're trying to mixed php with html a little too much. Its ok IF you were using php5, then you could use the print <<< HERE HERE; Why are you using a Internal style sheet and a External sheet? <?php function tabarea() { print(" <div class='tabArea'> <a href='?do=page&action=main' class='tab'>Home</a> <a href='?do=page&action=rpg' class='tab'>RPG</a> <a href='index.php' class='tab'>Forums</a> <a href='do=page&action=chatroom' class='tab'>Chatroom</a> </div> "); } ?> <head> <link rel='stylesheet' type='text/css' href='http://7thsky.7t.funpic.org/rpg/Themes/default/style.css?fin11' /> <style> .abody { background-image: url(http://7thsky.7t.funpic.org/rpg/images/banner.png); } body { background-image: url(http://7thsky.7t.funpic.org/rpg/images/background.png); } </style> </head> <body> <body valign='top'> <div class='abody'> <?php echo tabarea();?> <div class='body'> <table width='100%' cellspacing='0' cellpadding='0'><tr> <td class='leftmenu' valign='top' rowspan='2'> left menu here </td></tr> </table> </div> Quote Link to comment https://forums.phpfreaks.com/topic/51097-solved-php-function-problem/#findComment-251505 Share on other sites More sharing options...
desithugg Posted May 12, 2007 Author Share Posted May 12, 2007 umm thanx it worked. The reason i'm using an inner and outher style sheet is beacuse I was too lazy to go to the other stylesheet file and edit it lol. Quote Link to comment https://forums.phpfreaks.com/topic/51097-solved-php-function-problem/#findComment-251512 Share on other sites More sharing options...
Trium918 Posted May 12, 2007 Share Posted May 12, 2007 Select SOLVED please. You're welcome. Quote Link to comment https://forums.phpfreaks.com/topic/51097-solved-php-function-problem/#findComment-251518 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.