Form action
BenEfrati opened this issue · comments
Hi,
I built a simple form to insert data to mysql:
<form action="insert.php" method="post"> <label for=id>ID:</label> <input type="number" name="id"> <label for=array>array:</label> <input type="number" name="array"> <label for=url>url: </label> <input type="text" name="url"> <label for=metatitle>meta-title: </label> <input type="text" name="metatitle"> <label for=metadescription>meta-description:</label> <input type="text" name="metadescription"> <label for=title>title: </label> <input type="text" name="title"> <label for=content>content: </label> <textarea type="text" name="content"></textarea> </form>
as you can see, there is an action file which located at root folder, but when sending the form, "insert.php" file redirect to 404 page because the .htaccess file.
How should I create form with Ajax-SEO?
Thanks,
Ben
I found this line in .htaccess:
# Rewrite exceptions for specific path
RewriteRule ^assets/ - [L]
just cut & paste insert.php in assets folder.
For better security move insert.php to content/insert.php and include
it in index.php with condition like:
if ($url == 'insert') {
include 'content/insert.php';
}
other ways to avoid Apache rules for /insert.php add in .htaccess right after RewriteRule ^assets/ - [L]
:
RewriteRule ^insert.php - [L]
Whenever I will have more free time for it, I have in my plans to add a simplified CMS what will probably match your wishes.
It would be great,
Thank you