Problems with boolean calculator
Posted: Tue Aug 29, 2006 8:49 am
feyd | Please use
Thanks for your answers. NeverSeenMan
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hello.
I've created a simple boolean calculator, but it doesn't work properly: if answer is "false", it doesn't show an answer. Where is the problem? This is the program:Code: Select all
<DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org.TR/xhtml/DTD/xhtml-strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<title>Boolean calculator</title>
</head>
<body>
<form action="#" method="get">
<input type="text" name="input" value="<?php echo $_GET['input']; ?>" />
<input type="submit" value="»" />
</form>
<pre>
<?php
echo eval('return ('.$_GET['input'].');');
?>
</pre>
</body>
</html>feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]