Jump to content

Form Changing Changing Textarea


Recommended Posts

The sever which i am using runs on php5 so i think the problam is with the syntax. I keep on getting Fatal error: Function name must be a string. Could you please help cos been searching but have not been able to find anyting thanks.

<form method="post" action="display_input.php"><p><strong> Text Field</strong><br><textarea name="text" cols=45 rows=5 wrap=virtual></textarea></p><p><strong>String Functions</strong></br><input type="radio" name="func" value="md5" checked> get md5<br><input type="radio" name="func" value="strlen" checked> length of string<br><input type="radio" name="func" value="strrev" checked>reverse string<br><input type="radio" name="func" value="strtoupper" string uppercase<br><input type="radio" name="func" value="strtolower" checked>string lowercase3<br><input type="radio" name="func" value="ucwords" checked>first letter capital<br></p><p><input type="submit" name="submit" value="do Something with the String"><p></form>

And this is the other file

<?$result = $func($text1); ?><html><head<title> Generic Input Results</title></head><body><? echo "$result"; ?><p><a href="generic_form.html">Go again!</a><p></body><html>

Thanks for any help

Link to comment
Share on other sites

You're not getting the values from $_POST, you need to get the form data from the $_POST array. It's not going to automatically create the variables for you. That's an old option that is no longer in use.Also, don't put that script on a live server, it's a security risk.

Edited by justsomeguy
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...