Jump to content

$_POST['radio'] not working??


robert_gsfame

Recommended Posts

<?php

session_start();

?>

<?php require_once('configuration.php');

if(isset($_POST['button'])){

$checked=$_POST['check'];}

 

 

 

?>

<html>

<head>

</head>

<body>

<form name="form1" method="post" action="<?php echo $_SERVER['php_self'];?>">

<input type="radio" name="check">Check

<input type="radio" name="check">Check2

<input type="submit" name="button">

</form>

</body>

</html>

 

I cant get the result from the bold part after echo, what is wrong???

Link to comment
https://forums.phpfreaks.com/topic/182986-_postradio-not-working/
Share on other sites

<?php session_start();

require_once('configuration.php');

if(isset($_POST['button'])) {

$checked = $_POST['check'];

}



?>
<html>
<head>
</head>
<body>
<form name="form1" method="post" action="<?php echo $_SERVER['php_self'];?>">
<input type="radio" name="check">Check
<input type="radio" name="check2">Check2
<input type="submit" name="button">
</form>
</body>
</html>

 

Add a value to the checkbox's

 

James.

okay i got it, simple mistake but create a great and confusing problems

 

<form name="form1" method="post" action="<?php echo $_SERVER['php_self'];?>"> should be

 

<form action="<?php echo $_SERVER['PHP_SELF'];?>"  method="post" name="form1">

 

Finally, thx Jamesxsg1

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.