Last active
June 23, 2024 23:31
-
-
Save Shakil-Shahadat/8858f38d00e8c15dd752c4e680a1dc5d to your computer and use it in GitHub Desktop.
✓ Form Input Test: Variable Value in Radio Input, Proof of Concept
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Form Input Test: Variable Value in Radio Input, Proof of Concept (Success)</title> | |
</head> | |
<body> | |
<?php | |
// echo "<pre>"; print_r( $_POST ); echo "</pre>"; | |
echo 'Submitted Data: myChoice = '; | |
if ( isset( $_POST[ 'myChoice' ] ) && $_POST[ 'myChoice' ] === 'Bangla' ) | |
{ | |
echo $_POST[ 'myChoice' ]; | |
} | |
else | |
{ | |
echo $_POST[ 'myOtherChoice' ]; | |
} | |
?> | |
<form method="post"> | |
<label><input type="radio" name="myChoice" value="Bangla" required> Bangla</label> | |
<input type="radio" name="myChoice" value="Other"> | |
<input type="text" name="myOtherChoice" value="English"><br> | |
<input type="submit" value="Submit"> | |
</form> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment