Reply To: Using "Simple PHP" plugin generates errors

Home Forums Support Using "Simple PHP" plugin generates errors Reply To: Using "Simple PHP" plugin generates errors

#208590
Nik Bhatt

OK – I tried that and I don’t get any errors now. Thanks!

However, if I call that method (generate_test_function()) I get the same problem. It looks like it’s because the script code is injected PRIOR to the <html> tag (see below). That seems bad, but not fatal. Assuming it’s okay, this brings up my other question. I can define functions here, but how do I call them (and only on some pages, not all of them)? Calling them in the simple PHP causes an error. In my use case, I want to provide a search UI against some custom database tables, but only for certain pages, not all.

Thanks.

–Nik
———–

This is a test.<br />
<b>Warning</b>: Cannot modify header information – headers already sent by (output started at /home/bsa566/public_html/wp-content/plugins/generate-simple-php/custom.php:11) in <b>/home/bsa566/public_html/wp-content/plugins/wpclef/includes/lib/wp-session/class-wp-session.php</b> on line <b>130</b><br />
<!DOCTYPE html>
<!–[if IE 8]>
<html xmlns=”http://www.w3.org/1999/xhtml&#8221; class=”ie8 wp-toolbar” lang=”en”>
<![endif]–>
<!–[if !(IE 8) ]><!–>
<html xmlns=”http://www.w3.org/1999/xhtml&#8221; class=”wp-toolbar” lang=”en”>
<!–<![endif]–>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8″ />
<title>Edit Plugins ‹ — WordPress</title>
<script type=”text/javascript”>