Support » Fixing WordPress » Inserting A Custom Page

  • Hi, I’ve just written myself a new contact form in PHP and I’m wondering how I can include it in WordPress so it will go to

    I’ve tried just ploking the code in a new page and it obviously broke and I tried installing Ryan Duffs contact form and just over writing the thing… obviously that didn’t work.

    I also had a look across the WPcodex, but I wasn’t sure what I was looking for.

    Since it is php a php include won’t work I dont think, could anyone give me a clue as to what to do?

    Thanks very much.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Ah thanks, I’m using Exec PHP (I tried the other, but it is just displaying the code, not actually running it.) but I am getting a couple of Parse errors;

    Parse error: parse error, unexpected $ in /home/wwu/public_html/cncu5/wp-content/plugins/exec-php.php(16) : eval()’d code on line 2

    Parse error: parse error, unexpected ‘}’ in /home/wwu/public_html/cncu5/wp-content/plugins/exec-php.php(16) : eval()’d code on line 2

    Is this the plugin’s problem?

    Or is it my fault for trying to run it under WP2.0 RC1?

    I found that Intouch by Venushka Perera was the best contact form plugin. You can read about it and download it here:

    It creates an admin page in your WP Admin where you customize it, and it also tells you how to insert it into a page, which is by simply adding <!–intouch–> when you create a page via WP Admin.

    Ah thanks for that, unfortunately it is not quite what I was looking for. The contact form I’ve written (yes I can write a form but can’t do anything else :P) actually has multiple recipients as well as a visitor defined subject line. So including the php with something like Exec PHP seems to be the perfect option.

    The problem with the PHP plugin(s) may be caused by the code you’ve tried to execute. Try to copy/paste the code into a plain php page first and see if the PHP parser spits out any error. If not, you may contact the plugins author (which is me for the Exec PHP plugin 😉 ).

    You may also post your code here, but because of formatting issues in this forum, this sometimes does not display the same way, you typed it in this form.

    I have an enormous feeling that my coding just sucks 😛

    I’ve uploaded it to so you can easily view it in your browser if you would like to have a look.

    Thanks for all the help so far!

    AZKABAZ, after some few tests I don’t think it’s because of your coding skills 😉 It seems, that you’re not allowed to have an opening curly brace encapsulated inside of a ?php tag and close it in another one. This is because of the way, the plugin works. Normally on a usual PHP page, this _is_ allowed. The plugin uses the PHP eval() function. I’ll try to figure out, how to work around this problem (I hope there is a solution for this).

    You may want to try one of the other PHP plugins around, but as far as I know they are working much in the same way as mine, so don’t be disappointed if none of them are working with your code.

    Ah, excellent, thank you so much! =) I seem to have had the best luck with your plugin, so I think I will keep using that one 🙂

    For something custom… you can always create a Page template (see the Codex) and put your code in the template file. Then create a Page via the admin panel using that special template and you are done.

    Wow! Thanks moshu! That smacked the peg right in the hole!

    Anyway besides the workaround in using the WP pages feature, I fixed my plugin. It’s now able to also handle such kind of PHP code. Just check it out at:

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Inserting A Custom Page’ is closed to new replies.