marvin hunkin wrote:
Hi.
doing an assignment, for my Certificate Four In Website Administration.

The tutor list is down the hall.

now got a couple of problems.
will explain what i have to do.
create a html form, which i have done.
in textpad.
now, when i open the form, it does not set focus to the first form field which is the user name.
goes to the login button.
why is this?
can any one help me?

Yes.  Buy a book on Javascript.

okay, will explain.
and to create a script for a login page, on a network.
and using php, and now got the user to enter their username and password, and then to display a message, saying the person logged in, and to display the date. if the user, types in the wrong user name and password, then a error message is displayed, and a link back to the form, is displayed. now got the problem of a error, when checking to see if the error happened or not, and whether to let them in or not.
so will paste the html form, and the php code below.
if any one can help me how to fix these problems, then let me know asap.
cheers Marvin.


Html Form:


Code Starts Here:

<html>
<head>
<script language=text/javascript>
function SetFocus
{
document.forms[0].username.focus();
}
</script>
<title>User Login Form</title>
</head>
<body onload="SetFocus();">
<form action="UserDetails.php" method="post">
<p>User Name: <input type="text" name="username"> </p> <br>
<p>Password: <input type="password" name="password"> </p> <br>
<p><input type="submit" value="Login"> </p>
</form>
</body>
</html>


Php Code:


Code Starts Here:

    <?php
$_POST['username'];
$_POST['password'];
if ('username'='username') & ('password'='password')
{
echo "Letting you login into the tafe network. <br>\n";
echo "Marvin Hunkin has successfully logged into the Tafe network. <br>\n";
echo "Please Wait ... Loading Your Personal Settings ... <br>\n";
gmdate('d-m-Y', time()+(10*60*60));
}
else
{
echo "Not letting you login into the tafe network. <br>\n";
echo "Error! You did not type in a correct username! Please try again... <br>\n"; echo "Click on the link below to return back to the login form and enter your correct user name and password. <br>\n";
echo"'<a href="UserDetails.html">Return To Login Form</a>'";
}
?>

Code Error:

Code Starts Here:

Parse error: parse error in c:\program files\easyphp1-8\www\userdetails.php on line 4

I am Using Easy Php 1-8, and using http://localhost in the browser, and sending my files to the www folder of easy php.
Have A Great Day.
Marvin.


Instead of cutting and pasting, RTFM and understand what your code is (not) doing.

If this is level four, Most of us here would be a Grand Poobah.

--
By-Tor.com
...it's all about the Rush
http://www.by-tor.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to