I have a form:
<form action="<?php echo the_permalink(); ?>" method="POST">
<input type="text" name="name" value="" placeholder="Your First and Last Name *" />
<?php echo $firstnameError; ?>
<input type="text" name="email" value="" placeholder="Yoyr Email" />
<?php echo $emailError; ?>
<br>
<input type="text" name="company" value="" placeholder="Your Company Name" />
<input type="text" name="phone" value="" placeholder="Your Phone number" />
<textarea name="project" rows="4" cols="50" placeholder="Describe the scope of work and the most important features of the project *'"></textarea>
<?php echo $addressError; ?>
<br>
<input type="radio" name="budget" value="1500" />
<input type="radio" name="budget" value="2500" />
<input type="radio" name="budget" value="5000" />
<input type="radio" name="budget" value="10000" />
<input type="radio" name="budget" value="100001" />
<input type="radio" name="budget" value="not sure" />
<input type="hidden" name="submit" value="1" />
<input type="submit" value="SUbmit" />
</form>
It actions to the same page, but when I do print_r($_POST);
it does not print anything, i.e. no value in $_POST
.
What could be the reason(s) for this? I studied a few questions on SO on this but none gave me the answer I was looking for.
If your passing the name as a Post value, wordpress DOSNT like this!
change this
to
changing the name to thename, Will work guaranteed! 😉
You don’t need to echo
the_permalink()
.This works for me:
change this
to
I found same problem in my project and solution is in $_POST, maybe you use lower case in your code, change it to upper case.
change $_post to $_POST !
SOLUTION:
due to request problems, in wordpress sites instead of
You may need to point the .php file.. example:
//////p.s. echo is automatically done with
the_permalink()
[same is:echo get_permalink()