Can this be done?
I created a form which performs the function giveReaction. Can anybody tell me what I'm doing wrong?
This is my code so far:
function giveReaction (){
global $firstname;
if ( empty($firstname) ) {
$firstname = 'fill in your name, and get a response.';
echo "$firstname";
}
else {
$firstname = $_GET['firstname'];
echo "hello, $firstname";
}
}
echo "<form action=\"index.php?func_name=giveReaction()\" method=\"GET\">
<input type=\"text\" name=\"firstname\">
<input type=\"submit\" value=\"send\">
</form>";
giveReaction();
$firstname. Take a look at some php forms tutorial