robert_gsfame Posted November 26, 2009 Share Posted November 26, 2009 <?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 More sharing options...
jamesxg1 Posted November 26, 2009 Share Posted November 26, 2009 <?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. Link to comment https://forums.phpfreaks.com/topic/182986-_postradio-not-working/#findComment-965817 Share on other sites More sharing options...
robert_gsfame Posted November 26, 2009 Author Share Posted November 26, 2009 sorry what is written is incomplete.. i actually have added the value into each radiobutton, but still not working! Link to comment https://forums.phpfreaks.com/topic/182986-_postradio-not-working/#findComment-965818 Share on other sites More sharing options...
jamesxg1 Posted November 26, 2009 Share Posted November 26, 2009 <?php session_start(); require_once('configuration.php'); if(isset($_POST['button']) && isset($_POST['check'])) { $checked = $_POST['check']; echo 'Its checked!'; } ?> James. Link to comment https://forums.phpfreaks.com/topic/182986-_postradio-not-working/#findComment-965820 Share on other sites More sharing options...
robert_gsfame Posted November 26, 2009 Author Share Posted November 26, 2009 Jamesxsg1, , when i submit by pressing button it parse the value on url so i can only use $_GET to get the value although i have put "post" as a method. What is actually wrong with this??? Link to comment https://forums.phpfreaks.com/topic/182986-_postradio-not-working/#findComment-965825 Share on other sites More sharing options...
jamesxg1 Posted November 26, 2009 Share Posted November 26, 2009 change this <form name="form1" method="post" action="<?php echo $_SERVER['php_self'];?>"> to <form name="form1" method="POST" action=""> James. Link to comment https://forums.phpfreaks.com/topic/182986-_postradio-not-working/#findComment-965829 Share on other sites More sharing options...
robert_gsfame Posted November 26, 2009 Author Share Posted November 26, 2009 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 Link to comment https://forums.phpfreaks.com/topic/182986-_postradio-not-working/#findComment-965830 Share on other sites More sharing options...
jamesxg1 Posted November 26, 2009 Share Posted November 26, 2009 lmao. Its ok take care bud. James. Link to comment https://forums.phpfreaks.com/topic/182986-_postradio-not-working/#findComment-965832 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.