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/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php