PHP Wordpress Form -
i don't know heck problem form not working. form not sent anywhere. it's questionnaire clients fill/print out if like, cannot results post hidden div. doing wrong? installed wordpress php plugin , other php echo's work, not post thing. html:
<form method="post"> <input type="text" placeholder="your name" name="yourname" /> <br /><br /> <input type="text" placeholder="pet's name" name="petsname" /> <br /><br /> <input type="text" placeholder="pet's birth date" onfocus="(this.type='date')" onblur="(this.type='text')" id="date" name="petsbirthdate" /> <br /><br /> <strong>pet's sex</strong>: <input type="radio" value="male" name="sex" id="male" /><label for="male">male</label> <input type="radio" value="female" name="sex" id="female" /><label for="female">female</label> <button type="button" class="button" onclick="show_output();">display answers</button> </form> pay no attention onclick handler on button. i'm not including javascript, know hidden div show when button clicked. php returns no form results: pay no attention php in brackets, that's way works in wordpress plugin.
<p class="data_answers"> <strong>your name:</strong> [php]echo htmlspecialchars($_post['yourname']);[/php]</p> <p class="data_answers"> <strong>pet's name:</strong> [php]echo $_post['petsname'];[/php]</p> <p class="data_answers"> <strong>pet's birth date:</strong> [php]echo $_post['petsbirthdate'];[/php]</p> <p class="data_answers"> <strong>pet's sex:</strong> [php]echo $_post['sex'];[/php]</p> the php work (anywhere; placed in middle of, form answers should be, , shows up. why doesn't other work?
[php] echo "hello world!"; [/php] thank you! tracy
p.s. although cannot see php, actual page in draft here: http://www.safarivet.com/behavior-conditions/
you should add action attribute in form tag
<form method="post" action=""> ..leads same page
Comments
Post a Comment