inputName/outputName -- what am i doing wrong?
Okay, so first thank you altamira, banzaimonkey, and tomzilla for answering my last question! I love (and desperately need) the quick response on this board. :)
I'm trying to create a simple form where you input your name. If there's a name in the input field, the program should come back with "Hello (whatever the person's name is) welcome to this site." If there is no input, then it should come back with "Come back tomorrow with a name."
It's in two files -- inputName and outputName. I think the first one is fine but the error is in the outputName.php. Here is a link to inputName:
http://cim.saddleback.edu/~emontgomery1/inputName.html
Here is the code for outputName.php straight from the instructor (which does not work for me):
<?php
echo count($_GET)."<br />";
if( count( $_GET ) > 0 ){
echo "Hello ".$_GET['first'];
echo " Welcome to this Site<br />";
}
else{
echo "Come back tomorrow with a name<br />";
}
?>
I've tried playing around with the count number (changing it from 0 to 2). It either always returns the if or always returns the else, regardless of whether text has been entered, depending on which number I have in the if statement.
What am I doing wrong?
Thanks.
