I have been struggling with a problem working in both html and php. in my html, i have a form tag that includes:
<input type="text" name="car1" size="4" value="" /> car1
In my php, i have this:
$car1 = 'my favorite car is ' . $_POST['car1'];
echo $car1;
I am trying to figure out a way so that when the user does not input anything into the car1 field in html, echo $car1; will print nothing or blank but when the user does input something, $car1 will echo my favorite car is $car1.
I tried using if(empty() and if(isset() but i am having issues to make it work for some reason.
Any ideas to do this properly? thanks for the help!