WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Permalink problems! (7 posts)

  1. SDM36
    Member
    Posted 1 year ago #

    Hello,
    I've been making a contact form on my little site today, and have been very frustrated by an annoying yet seemingly quite simple problem.

    <form class="contactform" action="" method="post" name="contact_form">

    is the action of the contact form, the page url is:
    http://cssrecycling.co.uk/stage/contact-css-recycling/
    however when you press submit it takes you to the page:
    http://cssrecycling.co.uk/stage/stage/contact-css-recycling/
    and you get a 404.

    I have treid:
    hardcoding the url: (it inserts the extra '/stage/' still
    using a different page: still inserts an extra /stage/ in the url

    and I'm totally confused as to ehat its doing, the rest of the site links work fine it's only when I sue the <form action=""> that the url gets messed up!

    Am using post name permalinks and the blog lives in the /stage/ folder.
    Any advice is appreciated!

  2. esmi
    Forum Moderator
    Posted 1 year ago #

    Unless you want to start writing your own custom contact form plugin, I suggest you install an existing plugin such as http://wordpress.org/extend/plugins/contact-form-7/

  3. SDM36
    Member
    Posted 1 year ago #

    yep quite happy writing the php, already got my fields sanitized and I wanted to insert the successful message into the db, hence I started writing it myself as I couldn't find one which logged responses!

  4. esmi
    Forum Moderator
    Posted 1 year ago #

    Have you reviewed Writing_a_Plugin and the Settings_API?

  5. SDM36
    Member
    Posted 1 year ago #

    er nope not yet, I was hoping to discover why the post action of my form gave me the wrong url everytime! Until I get some data out of it I can't even begin to test anything.

    Is it not a permalink problem?
    The form is currently sitting within a page..

  6. esmi
    Forum Moderator
    Posted 1 year ago #

    It's not a permalink issue as such. it's the way you are approaching this. You cannot just add form markup to WordPress. It simply will not work. You have to do this by effectively writing a form plugin.

  7. SDM36
    Member
    Posted 1 year ago #

    hmmmm le sigh, I've managed it in the past, without any such issues!

    Having had a quick look through the two docs you mentioned I couldn't see any obvious information relating to forms?

    I did however find these:

    http://wordpress.org/support/topic/frustration-using-forms?replies=4

    and this

    http://wordpress.org/support/topic/how-to-use-forms-in-wordpress?replies=3

    both of which are useful, so i'm changing to resolved..

Topic Closed

This topic has been closed to new replies.

About this Topic