Re: Need Help Please
| From: | Chris | Date: | Mon, 22 May 2006 03:09:48 +0000 |
| Subject: | Re: Need Help Please | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-236599@lists.php.net to get a copy of this message | ||
marvin hunkin wrote:
Hi. doing an assignment, for my Certificate Four In Website Administration.Wow someone doing an assignment has written some code :) Good stuff!
$_POST['username']; $_POST['password']; if ('username'='username') & ('password'='password')This little bit of code is your problem. Firstly you want to assign the username and password to some variables: $posted_username = $_POST['username']; $posted_password = $_POST['password']; http://www.php.net/manual/en/language.variables.php#language.variables.basics Then you want to check them: if ($posted_username == 'username' && $posted_password == 'password') { .... in php, one = means "assignment" http://www.php.net/manual/en/language.operators.assignment.php to check a variable, use two - "==". http://www.php.net/manual/en/language.operators.comparison.php Lastly for some extra credit, you should read http://phpsec.org/projects/. -- Postgresql & php tutorials http://www.designmagick.com/