PHP Code:
<html>
<head>
<title> Testing </title>
</head>
<body>
<h2> The BACKWORD: </h2>
<br>
<?php
if(isset($string))
{
for($i = strlen($string)-1; $i >= 0; $i--)
{
print $string[$i];
}
}
else
{
?>
<FORM METHOD=POST ACTION="<?php echo $PHP_SELF;?>">
Enter a word: <INPUT TYPE="text" NAME="string">
<INPUT TYPE="submit" value="done!">
</FORM>
<?php
}
?>
</body>
</html>
ok, i need help with the above code. im trying to write a simple php script in which it ask a user for a word in the field textbox. then when the user press 'done!', it will output the user's word backword.
for some reason, when i press done! it always show the same "Enter a word" stuff.
Comment