Jump to content

[SOLVED] form problem


DEVILofDARKNESS

Recommended Posts

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

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.