Ok just a few things:
First Next time please post some code here in the forum, don't use images! This 'cause it's easier to make a copy and paste of it and to explain you where's the problem.
Second in the image you posted there is an error and I didn't see it.
You wrote:
Code:
echo "<form method='post'>
You are forgetting the "action" attribute.
You should write like this:
Code:
echo "<form method='post' action='/path/to/your_page.php'>
You have to do this also if you want to post it at the same page.
The receiver page has to contain the code to analyze sent by post.
You'll pick up the value with $_POST['name_of_radio']
I post you an example of this concentrated in the same page:
Code:
<?php
if ($key==""){
?>
<form action="./test.php?key=1" method="post">
<input type="radio" name="test" value="1"/>The value of radio is 1<br>
<input type="radio" name="test" value="2"/>The value of radio is 2<br>
<input type="radio" name="test" value="3"/>The value of radio is 3<br>
<input type="submit" name="Select" value="Post your choice"/></form>
<?
}
else{
$toprint=$_POST['test'];
echo "Now I got the value of radio, it is $toprint";
}
?>
You can see its working here
I hope that's enough to help you.
Bookmarks