multiple names

I’m trying to put differnt people names on this script so they see welcome text?

can you help?

[code]

A BASIC HTML FORM[/code] [php]<?PHP if (isset($_POST['Submit1'])) {

$username = $_POST[‘username’];
$surname = $_POST[‘surname’];
echo $_POST[“username” ];
echo $_POST[“surname”];

if ($username == “letmein”) {

if ($surname == "elder")

print (“Welcome back, friend!”);

}
else {

print (“You’re not a member of this site”);

}

}
else {

$username ="";

}
?>[/php]

[code]

[/code]

[php]if ($surname == “elder”) // <<< Missing bracket { here.[/php]

:wink:

I mean add other names apart from “letmein” and “elder”

i want other users with different names?

It’s never a good idea to hard code username/password combo’s into your scripts.
You can use text files to store them, although the preferred way is mysql i meant in a database, mysql just happens to be free.

However you choose to store them, you make a call to database/textfile for a matching pair, if so
say hi (or whatever) if no match, then do something else.

okay I get ya

Thanks

Albert

Sponsor our Newsletter | Privacy Policy | Terms of Service