header string problem
Posted: Fri Dec 25, 2009 4:18 am
i have just created a form to test string function.. i created this func.html
Help me out why header function is not working even on other scripts i made.. THANKS
And then created php file "func.php"<form method="post" action="func.php" />
<p> <textarea name="text" cols="50" rows="5" wrap="virtual"></textarea>
<br />
<input type="radio" name="func" value="md5" /> MD5 <br />
<input type="radio" name="func" value="strlen" /> String Length <br />
<input type="radio" name="func" value="strrev" /> String Reverse<br />
<input type ="radio" name="func" value="strtoupper" /> String to Upper<br />
<input type="radio" name="func" value="strtolower" /> String to lower<br />
<input type="radio" name="func" value="ucwords" /> First Word to Uper Case<br />
<input type="submit" name="submit" value="Go" />
Every thing is working fine when i remove this function<?
if (($_POST[text] == "") || $_POST[func] == ""))
{
header("Location: func.html");
exit;
}
$result = $_POST[func] ($_POST[text]);
?>
<b>The Result is <b><? echo $result ?>
i use this function because if user donot put text or select radio button then header function again bring user to main page..if (($_POST[text] == "") || $_POST[func] == "")) {
{
header("Location: func.html");
exit;
}
Help me out why header function is not working even on other scripts i made.. THANKS