please help, having problems with echoing things to the screen

Hi, first I will show you the simple code I start with, then I will tell you what is going wrong…

[b]//File Name is program1.php

<?php if (isset($_POST['user_input'])&&!empty($_POST['user_input'])) { echo 'Works'; } ?>


[/b]

Ok, so the ‘


’, textarea, and the Submit button do show up, but when I type something in the textarea and hit submit, nothing happens.
What is supposed to happen, as you can see in the code^, is that the word ‘Works’ should echo onto screen above the ‘
’.

I’m still learning php so if you know what’s wrong, try to explain it in a simple way please.
Thank You. ;D

Hi there,

The PHP code looks fine - the HTML seems to be the issue.

<form action='program1.php',method='POST'>

Try removing the comma from between the attributes:

<form action='program1.php' method='POST'>
Sponsor our Newsletter | Privacy Policy | Terms of Service