marcus1060 Posted November 27, 2005 Share Posted November 27, 2005 I'm trying to output php from a mysql db, but instead you just see the php coding in the browser. Help pls Quote Link to comment https://forums.phpfreaks.com/topic/2940-include-php-from-mysql/ Share on other sites More sharing options...
virtual_odin Posted November 27, 2005 Share Posted November 27, 2005 Show us your code. Immediate thoughts: Have you started with <?php ? Is the page name xxx.php ? Have you sent headers? Quote Link to comment https://forums.phpfreaks.com/topic/2940-include-php-from-mysql/#findComment-9888 Share on other sites More sharing options...
marcus1060 Posted November 28, 2005 Author Share Posted November 28, 2005 [!--quoteo(post=322412:date=Nov 27 2005, 03:34 AM:name=virtual_odin)--][div class=\'quotetop\']QUOTE(virtual_odin @ Nov 27 2005, 03:34 AM) 322412[/snapback][/div][div class=\'quotemain\'][!--quotec--] Show us your code. Immediate thoughts: Have you started with <?php ? Is the page name xxx.php ? Have you sent headers? <?php: yes xxx.php: yes headers: no The data is taken from mysql into a variable, and then echoed: echo "\n $summary"; I'm thinking the echo is the problem... Quote Link to comment https://forums.phpfreaks.com/topic/2940-include-php-from-mysql/#findComment-9927 Share on other sites More sharing options...
opeth_nj Posted November 29, 2005 Share Posted November 29, 2005 [!--quoteo(post=322893:date=Nov 28 2005, 06:14 PM:name=marcus1060)--][div class=\'quotetop\']QUOTE(marcus1060 @ Nov 28 2005, 06:14 PM) 322893[/snapback][/div][div class=\'quotemain\'][!--quotec--] <?php: yes xxx.php: yes headers: no The data is taken from mysql into a variable, and then echoed: echo "\n $summary"; I'm thinking the echo is the problem... Try this. echo $summary ."\n"; Quote Link to comment https://forums.phpfreaks.com/topic/2940-include-php-from-mysql/#findComment-9942 Share on other sites More sharing options...
marcus1060 Posted November 29, 2005 Author Share Posted November 29, 2005 That makes sense I'll give it a try. Edit: Nope, doesn't work... I'm thinking it might actually be some type of security thing I need to disable? Quote Link to comment https://forums.phpfreaks.com/topic/2940-include-php-from-mysql/#findComment-9943 Share on other sites More sharing options...
virtual_odin Posted December 3, 2005 Share Posted December 3, 2005 Another xxx.php page displays correctly, yes? Could it be that some of your global options are getting in the way? run PHP() and look at magic_quotes_gpc. I have just run up a test page and it works fine on my set up. magic_quotes ar off in my set up. Also, try dropping the quotes and the \n and just echo the variable. Quote Link to comment https://forums.phpfreaks.com/topic/2940-include-php-from-mysql/#findComment-9999 Share on other sites More sharing options...
marcus1060 Posted December 4, 2005 Author Share Posted December 4, 2005 [!--quoteo(post=324173:date=Dec 3 2005, 09:57 AM:name=virtual_odin)--][div class=\'quotetop\']QUOTE(virtual_odin @ Dec 3 2005, 09:57 AM) 324173[/snapback][/div][div class=\'quotemain\'][!--quotec--] Another xxx.php page displays correctly, yes? Could it be that some of your global options are getting in the way? run PHP() and look at magic_quotes_gpc. I have just run up a test page and it works fine on my set up. magic_quotes ar off in my set up. Also, try dropping the quotes and the \n and just echo the variable. Another xxx.php page displays correctly, yes?: yes magic_quotes_gpc: Had em on didn't work, had em off didn't work. [a href=\"http://noveis.net/?page=php\" target=\"_blank\"]http://noveis.net/?page=php[/a] to see my php() [a href=\"http://noveis.net/\" target=\"_blank\"]http://noveis.net/[/a] and view the source you'll see some php in the top article. removing ."\n": no dice Quote Link to comment https://forums.phpfreaks.com/topic/2940-include-php-from-mysql/#findComment-10003 Share on other sites More sharing options...
virtual_odin Posted December 5, 2005 Share Posted December 5, 2005 Could it be some nesting going on? Is your displayed bit of php within a string being echoed. I think this would achieve the result you are getting. You'd need to close the echo with "; before php would look for the next command otherwise it will just assume it is part of the echo. Quote Link to comment https://forums.phpfreaks.com/topic/2940-include-php-from-mysql/#findComment-10021 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.