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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.