patrickm Posted August 22, 2007 Share Posted August 22, 2007 I'm trying to build a website with a simple text input option. After the input, the input is checked and acted upon accordingly. This is followed by a new input line. For example: > input: test "test" is not known to me > input: _ So far, I've been trying things with the "do-while" loop (see code below), but so far, all I seem to get is a fixed input box and the "respons" being displayed below it. <?php do { echo "<form name=\"form\">Input:"; echo "<br><input value=\"\" size=\"30\" type=\"text\" name=\"invoer\">"; echo "</form>"; if ($invoer == "info"){ echo "<br>blah blah blah/n"; echo "<br>blah blah blah"; } if ($invoer == "help"){ echo "<br>Commands: help, clear, info"; } if ($invoer == "etc"){ echo "<br..etc.."; } } while ( $jedi == "1" ); ?> Note: there is no need (for me) to be able to break out of the loop (thus "jedi = 1" will never be so). Link to comment https://forums.phpfreaks.com/topic/66137-simple-looped-text-input/ Share on other sites More sharing options...
pranav_kavi Posted August 22, 2007 Share Posted August 22, 2007 echo "<form name=\"form\">Input:"; echo "<br><input value=\"\" size=\"30\" type=\"text\" name=\"invoer\">"; echo "</form>"; echo "-->".$invoer; //add this echo if ($invoer == "info"){ ............. wat do u get? Link to comment https://forums.phpfreaks.com/topic/66137-simple-looped-text-input/#findComment-330826 Share on other sites More sharing options...
patrickm Posted August 22, 2007 Author Share Posted August 22, 2007 The same "problem". Whatever I enter, will be displayed besides the --> and the input stays at its place. Input: test -->test Link to comment https://forums.phpfreaks.com/topic/66137-simple-looped-text-input/#findComment-330835 Share on other sites More sharing options...
patrickm Posted September 14, 2007 Author Share Posted September 14, 2007 There is no solution for this ??? Link to comment https://forums.phpfreaks.com/topic/66137-simple-looped-text-input/#findComment-348249 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.