0

ok i got a assignment to do for college, i gotta create a form, a simple form with just 2 textboxes for input of title & password, this is simple & i know how to do this, the next part of my assignment is to create a page with the following requirements:
-create a php function named loginDetails() which contain the following details, the parameters $m and $n to accept the title & password from the form, a variable $title receiving the value in textbox named title from the form & a variable $pass receiving the value in the password textbox from the form.

then i have to create the following arrays within the loginDetails() function
-array named $title with the follwing values (student, lecturer, admin)
-array named $passwd with the following values (abcd, efgh, ijkl)

then use for loop within the loginDetails function to check the entered details if they are correct.

i have done forms before with post & get methods but im completely lost here now & i cant seem to find exactly what i need for this here anywhre on the net, can anyone please help me me with this?

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by sensei punk
0

You are expected to show some effort when asking for schoolwork help. Post what code you have started or perhaps pseudocode fragments. Ask specific questions about what you are having trouble with.

0

the only code i have so far is my form & just the basic post method in the login script,

form:

<body bgcolor="#FFFFCC" >
<form action="login.php" method="post">
<h2>Title :</h2> <input type="text" name="title" /><br />
<h2>Password :</h2> <input type="text" name="pass" /><p />
<input type="submit" value="Login" />
</form>
</body>
</html>

login:

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Login</title>
</head>

<body>
<?php echo $_POST["title"] ; ?><br />
<?php echo $_POST["pass"] ; ?>
</body>
</html>

this is all i know how to do so far , i dont really get what to do with the function loginDetails() part with the $m & $n & the variable $title & $pass, the arrays & for loop i can figure out , its just this part here thats got me lost n buggered up

Edited by Ezzaral: Added code tags. Please use them to format any code that you post.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.