Jump to content

Using PHP in IP.Content pages in IPB 4


Jay4255

Recommended Posts

Posted

 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?

Posted

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 521

The 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.

Posted

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.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...