471,073 Members | 1,386 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,073 software developers and data experts.

Using variables in login script:

Hello,

I wondered if anyone could advise? I am trying to write a basic
script, which allows user's to enter there username, password in text
fields. Then we take these values and pass them to the method
login_user($userid, $password);

I was unsure how to take the text fields values, and store them in
variables, when the submit button is clicked? And report when the user
could not be logged , or the textfields contain no values?

Thank you

<?php

function login_form(){
global $PHP_SELF, $userid, $password;
?>
<html>
<head>
<title></title>
</head>

<body>

<div align="center">
<form method="post" enctype="multipart/form-data" action="<?php
echo $PHP_SELF ?>">
<table border="1">
<tr>
<th align="right">E-mail</th>
<td nowrap>
<input name="userid" size="25">
</td>
</tr>
<tr>
<th align="right">Password</th>
<td nowrap>
<input name="password" size="25">
</td>
</tr>
<tr>
<td align="center">
<input type="submit" name="submit" value="Login">
</td>
</tr>
</table>
</form>
<div>
</body>
</html>
<?php
}

login_form();
$user_info = login_user($userid, $password);

?>
Jul 17 '05 #1
0 1175

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Antwerp | last post: by
8 posts views Thread by chris_fieldhouse | last post: by
1 post views Thread by =?ISO-8859-1?Q?Brian_Sprog=F8?= | last post: by
10 posts views Thread by sheldonlg | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.