form not working in wordpress (7 posts)

  1. lostasylum
    Posted 8 years ago #

    I'm trying to use a direct <form method="post" action="example.php"> in one of my wordpress pages (let's say the page url is http://www.example/contact)

    example.php is located in the root folder.

    however, the form action doesn't work because when i click the submit button, it is looking for http://www.example/contact/example.php

    any ideas?

  2. moshu
    Posted 8 years ago #

    Don't use relative path for "example.php"

  3. lostasylum
    Posted 8 years ago #

    i have tried putting the full path for "example.php", but it still doesn't work.

    my root folder is /wordpress.

    so i've tried putting <form method="post" action="http://www.example/wordpress/example.php">, but it still doesn't work.

    is there something i'm missing?

  4. moshu
    Posted 8 years ago #

    Are you trying to put it, actually, in the content of a Page?
    I don't think it will ever work.

    That kind of stuff should always be put in a Page template.

  5. lostasylum
    Posted 8 years ago #

    ok, i tried to use the page template method, where i created form.php.
    then i created a new page that uses form.php, which in turns actions example.php

    the page template creation went fine, but when i click submit, it's still trying to locate http://www.example/wordpress/example.php

    i'm a real noob at this, so thanks for bearing with me...

  6. lostasylum
    Posted 8 years ago #

    hi moshu... i've finally solved the problem about my forms... it was due to the permalink solution that i used... after reverting back to the default page id format, the forms all work properly now...

    now i just have to find a way to make permalinks work for IIS... #$%@#$%$...

    thanks a lot moshu!

  7. stevepb
    Posted 7 years ago #

    Hello the solution is because the register globals being set to off!

    Create a subdirectory and place the example.php inside it i.e. http://www.example/wordpress/newfolder/example.php

    next change your server settings to globals on for that directory ONLY!

    Now your forms will work using the post method and change the actions to the new location of example.php file i.e.

    <form method="post" action="http://www.example/wordpress/newfolder/example.php">

    You can change your register globals setting in vhosts directory or some of the other .conf files on your server, and perhaps even using the .htaccess file are a few methods.


Topic Closed

This topic has been closed to new replies.

About this Topic