Use quotes like this:
$result = $_POST["func"];
Use quotes like this:
$result = $_POST["func"];
<HTML>
<HEAD>
<TITLE>Generic Input Form</TITLE>
</HEAD>
<BODY>
<FORM METHOD="post" ACTION="display_input.php">
<P><strong>Text Field:</strong><br>
<TEXTAREA NAME="text1" COLS=45 ROWS=5 WRAP=virtual></TEXTAREA></P>
<P><strong>String Functions:</strong><br>
<INPUT TYPE="radio" NAME="func" VALUE="md5">get md5<br>
<INPUT TYPE="radio" NAME="func" VALUE="strlen">get length of string<br>
<INPUT TYPE="radio" NAME="func" VALUE="strrev"> reverse the string<br>
<INPUT TYPE="radio" NAME="func" VALUE="strtoupper"> make string uppercase<br>
<INPUT TYPE="radio" NAME="func" VALUE="strtolower"> make string lowercase<br>
<INPUT TYPE="radio" NAME="func" VALUE="ucwords"> make first letter of all words uppercase</P>
<P><INPUT TYPE="submit" NAME="submit" VALUE="Do Something With the String"></P>
</FORM>
</BODY>
</HTML>
I have this code which associates to the following php script
<?php
if(($_POST[text1]=="")||($_POST[func]=="")){
header("Location: remote.html");
exit;
}
$result = $_POST[func]($_POST[text1]);
?>
<HTML>
<HEAD>
<TITLE>Results</TITLE>
</HEAD>
<BODY>
<?php
echo "$result";
?>
</BODY>
</HTML>
But on pressing the submit button, i get to display_input.php but i get an error saying that the constants 'text1' and 'func' are unidentified. What should i do?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks