DEVILofDARKNESS Posted January 31, 2009 Share Posted January 31, 2009 probably a semicolon or something forgotten, but it doesn't work at all, it only show me the buttons with Z To A checked, and if you click on A To Z it checks both? <html> <head><title>Gedichten -- overzicht</title> <link href="../standard.css" type="text/css" rel="stylesheet" /> <link href="gedichten.css" type="text/css" rel="stylesheet" /> </head> <body> <table class="look" height="100%" width="100%" border="1"> <tbody> <tr> <td width="10%" height="100%"><iframe class="frames" src="../functieknoppen/functieknoppen.htm" frameborder="0" width="100%" height="100%" scrolling="no"></iframe> </td> <td><center> <form action='gedichten.php' method='POST'> From Z To A: <input type="radio" name="ZA" value="ZA" checked="checked"> From A To Z: <input type="radio" name="AZ" value="AZ"> <!--<input type="submit" value="submit">--> </form> <?php require_once 'config.php'; // our database settings $conn = mysql_connect($dbhost,$dbuser,$dbpass) or die('Error connecting to mysql'); mysql_select_db($dbname); /*if($_POST['submit']) {*/ if($_POST['ZA']) { $query = sprintf("SELECT PName,UName,PText,URL,category From gedichten ORDER BY PName DESC"); $result = mysql_query($query); while($urlgedicht = mysql_fetch_array($result)) { print "<ul><li><a href={$urlgedicht['category']}/{$urlgedicht['URL']}.htm>{$urlgedicht['PName']} | {$urlgedicht['UName']} | {$urlgedicht['category']}</a></li></ul>"; } } elseif($_POST['AZ']) { $query = sprintf("SELECT PName,UName,PText,URL,category From gedichten ORDER BY PName"); $result = mysql_query($query); while($urlgedicht = mysql_fetch_array($result)) { print "<ul><li><a href={$urlgedicht['category']}/{$urlgedicht['URL']}.htm>{$urlgedicht['PName']} | {$urlgedicht['UName']} | {$urlgedicht['category']}</a></li></ul>"; } } else { print "<script type='text/javascript'>alert('There was an error while trying to give an overview!');</script>"; } /*};*/ ?> </center></td> </tr> </tbody> </table> </body> </html> Link to comment https://forums.phpfreaks.com/topic/143267-solved-form-problem/ Share on other sites More sharing options...
DeanWhitehouse Posted January 31, 2009 Share Posted January 31, 2009 The code should show you the checkbox for z-a checked and the other unchecked and then when u check one the other will still stay checked. Link to comment https://forums.phpfreaks.com/topic/143267-solved-form-problem/#findComment-751332 Share on other sites More sharing options...
DEVILofDARKNESS Posted February 1, 2009 Author Share Posted February 1, 2009 Oh thank you I didn't know that!, i knew that ofcourse! My question is what DO I WRONG! Link to comment https://forums.phpfreaks.com/topic/143267-solved-form-problem/#findComment-751879 Share on other sites More sharing options...
DeanWhitehouse Posted February 1, 2009 Share Posted February 1, 2009 Wow, if you did know that then you would know what you are doing wrong. If i am right from your badly written question, all you need to do is change them to radio boxes with the same name. Link to comment https://forums.phpfreaks.com/topic/143267-solved-form-problem/#findComment-751912 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.