• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

RESOLVED Problem in receiveing Form information

Messages
2
Likes
0
Points
1
#1
I have added this snippet to the page mbti-1 :
HTML:
<form action="/mbti-2?wbcr_php_snippet" method="post">
   
   <input name="n" type="text">

   <fieldset id="group1">
      1- آیا شناختن شما<br>
      <input name="group1" type="radio" value="1"> الف) آسان است؟ <br>
      <input name="group1" type="radio" value="2"> ب) دشوار است؟
   </fieldset></p>

   <input type="image" src="imgsubmit.png" alt="Submit" width="150" height="48">

</form>
And I have added this snippet to the page mbti-2 :
PHP:
function wbcr_php_snippet() {
   if( isset($_GET['wbcr_php_snippet']) ) {
      echo $_post["n"];
      echo $_post["group1"];
      exit;
  }
}
Why it doesnt print "n" and "group1" in the page mbti-2 ??
 

Temyk

Developer & Support
Messages
1,129
Likes
42
Points
48
#2
Hello.

Why did you wrap the form handler to a function? It's won't work.
Try this:
PHP:
if( isset($_GET['wbcr_php_snippet']) ) {
      echo $_POST["n"];
      echo $_POST["group1"];
      exit;
  }