simple php question

Hello

I’m using a tutorial: http://www.homeandlearn.co.uk/php/php4p6.html

there’s a script, which just does not work the way it should… Just cant figure out why. Code is below. Instead of doing what it suppose to, it just prints “You are not a member of this site”, whether I submit “letmein” or whatever else.

A BASIC HTML FORM <?PHP $username=$_POST['username']; if ($username=="letmein") { print ("Welcome back, friend!"); } else { print ("You're not a member of this site"); } ?>

I think

[php] [/php]

should be

[php] [/php]

Its right at the top of the page of the link you provided IN BOLD. It clearly says add the NAME to the form. All you had to do was read what you linked to.

Sponsor our Newsletter | Privacy Policy | Terms of Service