I want to pass my form data to default file of a directory.

For eg:-

My default file for a directory is "Default.php".
If i give,

<form action="Directory">
</form>

, then the form data should be passed to "Default.php".

Is this possible ??

If so how ??

You could always use apache's mod_rewrite, so forward all requests for http://www.example.com/directory/ to http://www.example.com/directory/default.php.
You'd need to add one for each directory though I think.

And it may be worth adding a parameter on the URL such as ?form so that you can distinguish between form submissions and normal page accesses if default.php serves a page to users without form submissions.


R

hi, i will give you example:
<form name="form" method="POST" action="default.php">
if there any problem please tell me.

if you already change the default file for that folder using mod_rewrite, i think you can just use the directory name as a value inside the action. You don't need to include the default.php anymore.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.