Custom PHP search code

Recommended Posts

healthcareledger
0

healthcareledger 0

I am trying to enter some custom search php code on a page and post the results of the search on the same page. How can I go about doing so? I have the code and have added it the contentbox. It keeps going to an index.php page.

Share this post

Link to post

Share on other sites

catrina
103

catrina 103

When I search for something, I get this error:
[code]Fatal error: Call to a member function find() on a non-object in /home/content/40/6669540/html/wordpress/wp-content/plugins/exec-php/includes/runtime.php(42) : eval()'d code on line 941[/code]
There is some kind of error occurring in one of the files for Exec PHP plugin you're using to input your PHP. What happens if you placed the code for the search results on a different page?

Please read the docs before posting. Please do not private message me unless I ask you to.

Share this post

Link to post

Share on other sites

healthcareledger
0

healthcareledger 0

The same error shows up. Let me ask you this and this might help resolve the issue. I uploaded the exec-php plugin to include custom php code in the html tab. Since I am unable to use the code in the html tab of the page and view the result, I used the code in the contentbox of the mete settings of the page.
Is there a way to view the code that was originally pasted in the html tab of the page?

Share this post

Link to post

Share on other sites

catrina
103

catrina 103

[quote]Is there a way to view the code that was originally pasted in the html tab of the page? [/quote]
What do you mean by "originally pasted in the HTML tab"? Did you paste the code there in a page before?

Please read the docs before posting. Please do not private message me unless I ask you to.

Share this post

Link to post

Share on other sites

healthcareledger
0

healthcareledger 0

This is what I am trying to do:
1. create some custom code to search against a table in the database
2. Display the search results either on the same page or a new page
Is there a tutorial on how to include custom code in the pagelines templates?

Share this post

Link to post

Share on other sites

Simon 248

Simon 248

Well you could create a custom section, and include your code there, but strongly suggest you have a look at the wordpress codex on correct use of the $wpdb class, which will sanitize any queries going to the database.