I have a form on the inside template of WordPress.
<?php
/*
Template Name: Template Form Submission
*/
get_header(); ?>
<div class="entry-content">
<div style="width: 1000px;" align="left">
<form enctype="multipart/form-data" name="file_uplaod" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<input type="text" name="name" id="name" /><br /><br />
<input type="text" name="email" id="email" /><br /><br />
File <input type="file" name="test_file" id="test_file"/><br /><br />
<input type="submit">
</form>
</div>
But the problem is PHP-SELF is not working after form submission and it is going to index.php page. I am unable to use Javascript Redirect as File Upload is here. So can anybody help me to solve it.
then replace
with
See http://dev.kanngard.net/Permalinks/ID_20050507183447.html
I believe you can just omit the action from the form tag to submit to your current url. If wordpress SEO urls are active then $_SERVER[‘PHP_SELF’] will resolve to index.php.