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??? Quote Link to comment 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. Quote Link to comment 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! Quote Link to comment 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. Quote Link to comment 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??? Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
jamesxg1 Posted November 26, 2009 Share Posted November 26, 2009 lmao. Its ok take care bud. James. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.