WordPress.org

Forums

php contact form hell :( (5 posts)

  1. g3legacy
    Member
    Posted 4 years ago #

    I'm writing a php contact from using a PHP book. Its seems to work well, the contact form is located on one page, the user submits info and fires a new script that checks the content. I can't however get this to work with wordpress....i've made the first contact form script into a template which has become my contact us page. The second script will not work as another template. I cant link the two together.

    Ive tried trying to put both scripts on one page but the $_SERVER['php_self'] command will not work. It either returns to the site root or won't find (404) the other script.

    Its generally doing my head in, any ideas? I really want to learn this, not use a plug in. I understand what the php script is doing so this has become very frustrating.

    Any help is appreciated, Dan

  2. esmi
    Forum Moderator
    Posted 4 years ago #

    You need to, effectively, write a plugin.

  3. Kovacic
    Member
    Posted 4 years ago #

    Also you may want to check the variables you are using and make sure you are cont conflicting with wordpress native variables. You can get a contact script from almost anywhere on the net, take that and integrate it as a plugin. Just make sure your variables don't bump heads.

  4. g3legacy
    Member
    Posted 4 years ago #

    Hi, thanks for the replies.

    @esmi - I have no experience of writing a plugin, only normal php (not a wordpress site) or making themes with wordpress. Where would you recommend I start if i'm to properly integrate a plug in?

    @Kovacic - yes good point, i'm usually aware of this but I will check through once more. I'm generally using my own variables and sending the form content with posts. I just can't get to the next page to get the content from the form and check it.

  5. esmi
    Forum Moderator
    Posted 4 years ago #

    Start with Writing_a_Plugin

Topic Closed

This topic has been closed to new replies.

About this Topic