I have my custome theme in wordpress.This is the path of my custome theme. C:\wamp\www\wordpress2\wp-content\themes\sscy1002\sscy1002
I have created a Page in wordpress which contains some form elements. Here is my Page Code :
<form action="<?php bloginfo('stylesheet_directory'); ?>/Query.php" enctype="multipart/form-data" method="post" name="contact">
<label for="author">Name:</label> <input class="required input_field" id="author" type="text" name="author" />
<div class="cleaner h10"></div>
<label for="email">Email:</label> <input class="validate-email required input_field" id="email" type="text" name="email" />
<div class="cleaner h10"></div>
<label for="subject">Subject:</label> <input class="input_field" id="subject" type="text" name="subject" />
<div class="cleaner h10"></div>
<label for="text">Message:</label> <textarea class="required" id="text" cols="0" name="text" rows="0"></textarea>
<div class="cleaner h10"></div>
<label for="image">Image:</label><input type="file" name="file" />
<input class="submit_btn float_l" id="submit" type="submit" name="submit" value="Send" />
<input class="submit_btn float_r" id="reset" type="reset" name="reset" value="Reset" />
</form>
And here is my Query.php code under C:\wamp\www\wordpress2\wp-content\themes\sscy1002\sscy1002 directory :
<?php
get_header();
?>
<?
$name=$_POST['author'];
$email=$_POST['email'];
$subject=$_POST['subject'];
$message=$_POST['text'];
$image=$_FILES['file']['name'];
move_uploaded_file($_FILES['file']['tmp_name'],"imagess/".$image);
echo $name."<br/>";
echo $email."<br/>";
echo $subject."<br/>";
echo $message."<br/>";
echo "<img src='imagess/".$image."' alt='image'>";
?>
<?php
get_footer();
?>
But when I am submitting form I am getting fatal error :
Fatal error: Call to undefined function get_header() in C:\wamp\www\wordpress2\wp-content\themes\sscy1002\sscy1002\Query.php on line 2
Please help me how to pass transfer data from one page to another file(or if Page) in wordpress. I also searched answer on google but and tried all the way which I got from google but not working.
Sorry about wrong formatting of Question. Please help me!!!! Thanks!!!
functions.php
where it should be? tommcfarlin.com/sending-data-postget_header
,add_action
atc. functions avilable. If u want to make a page witch will take your post data you should consider creating page template and submiting form to a page link wich has page template...