Jay4255 Posted June 26, 2015 Share Posted June 26, 2015 After upgrading to IPB4, all of my IP.Content pages that contained PHP stopped working. I tried creating a new page and using the standard<?php echo "Hello World"; ?>but nothing works. How do I use PHP in IP.Content now? Link to comment Share on other sites More sharing options...
opentype Posted June 26, 2015 Share Posted June 26, 2015 Link to comment Share on other sites More sharing options...
Jay4255 Posted June 26, 2015 Author Share Posted June 26, 2015 Well, that sorta works. Now the page says Hello World, and has the following error:Fatal error: Uncaught exception 'ErrorException' with message 'Cannot modify header information - headers already sent by (output started at /www/forums/system/Theme/Theme.php(3811) : eval()'d code:9)' in /forums/init.php:521 Stack trace: #0 [internal function]: IPS\IPS::errorHandler(2, 'Cannot modify h...', '...', 521, Array) #1 /forums/init.php(521): header('HTTP/1.1 500 In...') #2 /forums/init.php(500): IPS\IPS::genericExceptionPage() #3 [internal function]: IPS\IPS::exceptionHandler(Object(ErrorException)) #4 {main} thrown in //forums/init.php on line 521The page also isn't loading the ipb wrapper even though I have it set to Yes, but I imagine that's related to that error. Link to comment Share on other sites More sharing options...
opentype Posted June 26, 2015 Share Posted June 26, 2015 It doesn’t make sense to use ECHO in a template. The template is for assembling the page code, not for outputting stuff directly to the browser. Try with some useful code. Link to comment Share on other sites More sharing options...
Jay4255 Posted June 26, 2015 Author Share Posted June 26, 2015 I'm not using templates, just pages Link to comment Share on other sites More sharing options...
opentype Posted June 26, 2015 Share Posted June 26, 2015 Same thing. Use the template logic I linked. To output something on the page, it would look like this:{{$myvariable='Hello World!';}} {$myvariable} Link to comment Share on other sites More sharing options...
Jay4255 Posted June 29, 2015 Author Share Posted June 29, 2015 I appreciate the help, I have managed to re-write the pages I needed using the formatting above. I found an article stating that you can't use custom built functions and need to do an include. However if I do an include. However, I can't seem to get it to work. The page saves without any errors, but when you try and view the page it shows a configuration error message. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.